Add to cart changes in Choose a product variant first after page refresh

Started by ronaldotto, July 09, 2012, 05:59:11 AM

Previous topic - Next topic

ronaldotto

after update from 2.06 to 2.08c and update from Joomla from 2.5.4 to 2.5.6 (sorry, did not check in between) i got the following behaviour:
"Add to cart" button changes in "Choose a product variant first" button after page refresh
The product has no variants (and if it did, it is still strange behaviour)
This does not happen in a browser with disabled javascript.

site: http://sportenspelweb.bouwtnu.nl/online-winkelen/air-hockey-tables/buffalo-mini-air-hockey-table-explorer-detail
(stil in development so ignore some design issues :-) )

ronaldotto

downgraded /administrator/components/com_virtuemart to 2.06 and that solved the problem.

Wil upgrade now so you can see the behaviour again

ronaldotto

changing customfields.php to the 2.06 version resolves the problem.
Looking for changes.

ronaldotto

line 1067                         if($customfield->parentOrderable==0){  should be if($customfield->parentOrderable==1)(

Will this be fixed? It renders a shop unusable

Milbo

We fixed it, the problem in your case is that there is somewhere a product with dynamic variant. 2.08D then.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/


tinfoilball

From reading through this thread for "Choose a product variant first" it would seem that the problem was solved. I have a clean install of J! 2.5.6 and VM 2.0.8e.

The error has affected my installation after I created a Cart Variant Custom Field. The custom field had two default options yes;no. One with a charge and one without. I removed the custom Variant and cleared all cache for site and for the browser. I've check manually through the db to ensure no trace of the custom field was left behind but I could not find any traces. In the end I've had to hack /components/com_virtuemart/helpers/shopfunctionsf.php

From this:
if($orderable){
$html = '<input type="submit" name="addtocart" class="addtocart-button" value="'.JText::_('COM_VIRTUEMART_CART_ADD_TO') .'" title="'.JText::_('COM_VIRTUEMART_CART_ADD_TO') .'" />';
} else {
$html = '<input name="addtocart" class="addtocart-button-disabled" value="'.JText::_('COM_VIRTUEMART_ADDTOCART_CHOOSE_VARIANT') .'" title="'.JText::_('COM_VIRTUEMART_ADDTOCART_CHOOSE_VARIANT') .'" />';
}

return $html;
}


to this:
//if($orderable){
$html = '<input type="submit" name="addtocart" class="addtocart-button" value="'.JText::_('COM_VIRTUEMART_CART_ADD_TO') .'" title="'.JText::_('COM_VIRTUEMART_CART_ADD_TO') .'" />';
//} else {

// $html = '<input name="addtocart" class="addtocart-button-disabled" value="'.JText::_('COM_VIRTUEMART_ADDTOCART_CHOOSE_VARIANT') .'" title="'.JText::_('COM_VIRTUEMART_ADDTOCART_CHOOSE_VARIANT') .'" />';
//}

return $html;
}


I would greatly appreciate any further information regarding the status of this bug as it seems unclear if the bug has been completely solved or what version of VM we should be using that is "Stable"


RevoLion

Just upgraded my VM from 2.0.10 to 2.0.12f and now non of my custom fields or add to cart buttons or price is showing and I have no idea how to downgrade? What did I do wrong? I have Joomla 2.5.7

www.thehummingbirdstore.com

gpessoa

Quote from: RevoLion on November 05, 2012, 21:19:47 PM
Just upgraded my VM from 2.0.10 to 2.0.12f and now non of my custom fields or add to cart buttons or price is showing and I have no idea how to downgrade? What did I do wrong? I have Joomla 2.5.7

www.thehummingbirdstore.com

Just run a SQL Update:
UPDATE `[prefix]_virtuemart_product_prices` SET `virtuemart_shoppergroup_id`=NULL WHERE 1

See here:
http://forum.virtuemart.net/index.php?topic=109112.15
J 4.4.4; VM 4.2.6; PHP 8.3.6

RevoLion

OK I went to the databse and selected SQL tabe and pasted the code you pointed me to in the SQL field and clicked ok and got this error back "#1146 - Table 'thehummb_jo151.[prefix]_virtuemart_product_prices' doesn't exist"
but I can see the " j25_virtuemart_product_prices" existing... I am very puzzled.

gpessoa

Did you replace `[prefix]_virtuemart_product_prices` by yours `j25_virtuemart_product_prices`?
J 4.4.4; VM 4.2.6; PHP 8.3.6

RevoLion

Please forgive my ignorance.....LOL. Yes I finally figured that I needed to change [prefix] to my actuall prefix of j25, I fill dumb...LOL. Thank you so much for your guidance @gpessoa.

Jeremy

Ninjab

I am having a similar issue.

I create a parent product and then two child products. And add a generic child variant in custom fields.

Doing that removes add to cart button on the parent page so it can't even be ordered. The child products are in the drop down list and the add to cart buttons are on those pages. But you are not able to select the parent product from the list.

So I need to have the parent item to be able to add to cart, the parent item to be selectable in the child dropdown list in both parent and child products. Can someone please help with this?

The only way I can do it at the moment is create a dummy parent product and cloning it as a child product. I think this is not a good way to do it and with many products can get confusing. Thanks.

Maxim Pishnyak

Quote from: Ninjab on August 12, 2013, 05:17:47 AM
And add a generic child variant in custom fields.
....
So I need to have the parent item to be able to add to cart, the parent item to be selectable in the child dropdown list in both parent and child products. Can someone please help with this?
Did you check options of generic child variant in custom fields?
You can support Community by voting for Project on the JED
https://extensions.joomla.org/extension/virtuemart/#reviews
Join us at
https://twitter.com/virtuemart

Ninjab