X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (X-Cart 5) (https://forum.x-cart.com/forumdisplay.php?f=56)
-   -   Change Attribute in Cart not working (https://forum.x-cart.com/showthread.php?t=69756)

pgailinas 08-06-2014 02:24 PM

Change Attribute in Cart not working
 
When in the shopping cart, I select to "Change attributes" of a product and a window pops up which lets me select a different attribute from a dropdown. When I select "Change", I get a message as follows:

"Product with selected attribute value(s) is not available or out of stock. Please select other."

tony_sologubov 08-08-2014 05:06 AM

Re: Change Attribute in Cart not working
 
Hi!

Do I understand you correctly the product with chosen attributes on cart page is actually in stock? If so, could you please send me the snapshot of attributes configuration for the problem product?

Thank you.

Tony.

pgailinas 08-14-2014 02:29 PM

Re: Change Attribute in Cart not working
 
Problem occurs for any product I have configured to have variants.

The functionality seems to work fine when I am on a Product Details page. On that page, I can select different variants and the SKU and color changes appropriately. I can add the product variant to the cart fine. I can then go to the cart and, if I want, check out fine. However, when I go to the cart and select "Change attributes", a pop-up appears where I can select the new attribute from a drop-down. So far, so good. Now, the problem occurs when I select the CHANGE button to apply the variant change. At that time, I get an error message "Product with selected attribute value(s) is not available or out of stock. Please select other."

As described above, product is in stock and can be selected fine on the Product Details page. Issue seems to occur on the Cart page.

tony_sologubov 08-18-2014 05:40 AM

Re: Change Attribute in Cart not working
 
Hi!

Can you please send me a link to the product that has this problem? You can pm it, if necessary.

Tony.

pgailinas 08-21-2014 12:27 PM

Re: Change Attribute in Cart not working
 
PM sent with login info.

tony_sologubov 08-22-2014 04:15 AM

Re: Change Attribute in Cart not working
 
Hi Phil!

I managed to replicate the problem and it is caused by the bug. I have already reported it to the team and it will be fixed in next versions.

Meanwhile, you can apply a workaround fix. Change the classes/XLite/Module/XC/ProductVariants/Controller/Customer/ChangeAttributeValues.php file and replace there the following line:

PHP Code:

if ($variant && $variant->getAmount()) { 


with the next one:
PHP Code:

if ($variant && $variant->getAvailableAmount()) { 


After you rebuild the cache the problem will be fixed.

Tony.

pgailinas 08-22-2014 05:49 AM

Re: Change Attribute in Cart not working
 
Thank you Tony, your fixed took care of that bug.

tony_sologubov 08-25-2014 04:49 AM

Re: Change Attribute in Cart not working
 
Happy to hear that!

Tony.


All times are GMT -8. The time now is 04:18 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.