Jump to content

Products attributes are wrong


koolmind

Recommended Posts

Good evening,

a client of mine asked me billions of modification on the template (and also on some controllers) and I believe that something has gone wrong now!

 

I have 3 product attributes, Type, Size, Sex, for my product (a t-shirt) but when I save one product into the cart I always get the custom combinations (Type1, Size1, Sex1).

 

I need to know what function and file are responsible of the cart updating operation.

 

I tryed to trace the POST data using Chrome Code Inspector, and the page /cart receive the correct combination of attributes. But somehow, when the product is saved, a default combination is picked up.

Really bad problem!!
HELP

 

Prestashop v1.4.8.2

Link to comment
Share on other sites

The function that adds/removes a product from a cart would be this one in classes/Cart.php

 

/**
* Update product quantity
*
* @param integer $quantity Quantity to add (or substract)
* @param integer $id_product Product ID
* @param integer $id_product_attribute Attribute ID if needed
* @param string $operator Indicate if quantity must be increased or decreased
*/
public function updateQty($quantity, $id_product, $id_product_attribute = NULL, $id_customization = false, $operator = 'up')
 
 
Maybe you forget to add the id_product_attribute here, so that maybe the default one is chosen?
 
My 2 cents,
pascal
Link to comment
Share on other sites

Thank you Pascal. I never made modification to that function, so I guess that I have to look for the code that call it and see if the correct parameter is sent.

I cannot understand what happened. I just modified a couple of controllers to include a Gift Message to ship with my object.

Link to comment
Share on other sites

I just discovered a strange behaviour!

When I click on "Add To Cart" button, Prestashop shows ad url like /order?ipa=<number>

As far as I know, ipa stands for Id Product Attribute and it should represent the attribute conbination I'm trying to by... for example Tshirt, sex Male, Size Large

 

In my case, IPA is equal to the Product ID!! That's the problem! I need to find out where the ipa parameter is wrongly generated before passing it to the update function of my cart.

 

Any hint?

 

Thank you

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...