Prestashop: Custom vouchers based on weight (PHP) - php

I'm working in a prestashop store for a client. He wants to focus on the clothes weight to set the price so I've modified all the tpl files needed to display this attribute accordingly. However, I'm experimenting some issues to find an approach to generate custom vouchers based on the total cart weight.
The idea is when a customer reach, in example, 0.5 kg, he or she automatically gets a discount code. Difficult here is that PS/Settings only set vouchers based on price rules. I thought that maybe I could work with a php or tpl backend file but vouchers are related with the database. Taking all in consideration I'm wondering if some of you have tried this kind of modifications and could advice me about what files I should be working with and what kind of code functions a I will need.
Thank you in advance!!

Related

PrestaShop 1.7.x multiple prices

I'm currently writing a module for prestashop to have 3 basic prices for customers(retail, small wholesale, big wholesale), each applied depending on total cart price
(if totalPrice>1000 apply small wholesale, if totalPrice>2000 apply big wholesale)
I have some idea how to implement but i want to know
a)how is price being calculated and stored in presta
b)how to add additional fields into pricing of product to enter different prices
Also, i read that it should be implemented using hooks, but i dont understand how exactly they work

Magento 1 wrong Shipping rates

we are using Webshopapps Product Matrix Rates pro version
after asking the developers of this extension they are saying that it's NOT the extension that is causing the issues as the logs say it's returning the correct values.
We have a shipping matrix setup for UK postcodes that requires a delivery charge for certain UK postcodes this is on a multi site setup which as 2 sites.
What should happen is per pallet added to the cart it should add £4.80 where a charge is required based on the postcode entered, so If I have 2 pallets the shipping cost to the postcode would be £9.60 and £4.80 for each extra pallet added there after, for the economical 2-3 day delivery.
On site one if I add 5 pallets the shipping cost is coming back at £28.80 where it should be £24
On site two If I add 5 Items the shipping cost is coming back at £9.60
I have no Idea why it is doing this as both sites are using the same code / theme apart from the logo and CSS for the colours of the site.
If anyone has any suggestions for a fix it would be much appreciated.
sorry I can't put code here or setting as I have no idea what I need to post for you to view.
Regards
Mal
Sorted, turns out after the developers going through the logs and a lengthy chat, which the boss remembered something very important they had done on the products on the other site I was trying to match, once I found this out it all made sense and got it working correctly, so there wasn't any bugs and it's working correctly all along ARGH!!!!
Basically any products on the first site where the weight was over 850KG was set to 850KG regardless.
on the new site the correct weights have been added, so anything over 850KG was adding the extra cost, then they didn't update the CSV to reflect this.

How to create attribute based product in magento?

I need to set product based upon their weight and dimension for a delivery system, so i have created sample 5 products each having different attribute based upon their w&d .Then each time when admin places order to a customer(adding to shopping cart) from those products based upon w&d. Now the problem i face how to change the Image and description of the product or order for each customer i have placed this image and description varies for every customer. Is there a way do it. I am open to any suggestion to achieve this can also use php and js if needed. Thanks.
You have solved it yourself alraedy by saying "image and description varies for every customer", so it would make sense to add customer attributes that hold this information. You will have to modify stuff around in your .phtml files though to make this fully work.
Furthermore it would be good if you included what you have tried already.

php and interspire grab information from dropshipper

I need to grab information from my dropshipper's site. The only thing I really need to grab is the inventory count. What would be the best technique for doing this with php? Should I use cURL? If so, can you please give me some example code of how to do it?
P.S. I am using interspire shopping cart too
Thanks in advance
It's tough to answer without knowing what your dropshipper allows. Mine gave me a detailed user guide with several ways to get data from their servers (cURL, Ruby, PHP, Perl, etc. all with example code).
The way I handled real time stock levels was to build code from one of their examples and using XML-RPC grab the stock levels from the supplier when a customer navigates to the individual product pages. The response from the supplier's server is just the stock number for that product (based on the SKU). My code then inserts that stock level into the prodcurrentinv field in the database for that particular product. This all happens in a split second before the page loads fully (before the stock level display on the page). I added it as a function in class.product.php.
Because I don't really know PHP, I wasn't able to get this to work with more than one SKU at a time (for use in the shopping cart and on the category product listing pages). I'm hiring a programmer for that.
But it's really important to know what type of interaction your supplier allows and it's hard to answer your question without knowing that.

module for Ubercart to run a discount per product in Drupal?

Hey guys I'm looking for a module and combination of modules to let me add items to Ubercart with discounts. How did you apply them?
These items need to have their own discounts that are not applied to the entire cart, just that product. They should also not require user input to get.
The discount will be based on the quantity of the product added. That is for example:
at 1-10 items, a 5% discount
at 11-25 items, a 25% discount
and so one
So, I can have two or more products all having different discounts based on the number of each. For example:
3 apples 15% discount
1000 nuts 50% discount
I have tried a few options and had no luck, including http://drupal.org/project/uc_discounts_alt, however it is not working with Drupal 6.2.
Also, I'm ok with having to write php to get this to work so if there is something that will let me do that then awesome.
P.S. I'm new to Ubercart but I do not think this is a built in feature
Have you tried uc_coupon module ? I think it's going to help you a lot. ;)
I had this same issue once.
The first time I did it, I utilized uc_get_cart_contents, hard coded my discount conditions, and adjusted the price accordingly. Works, but, doesn't scale.
The second time, I used uc_coupon module. Saved time.

Categories