News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Broken cart pricing after version 3.4.5

Started by gowifi, February 07, 2020, 05:20:36 AM

Previous topic - Next topic

gowifi

On our website, customers have the option of adding an extended warranty to their products. This option that is done through the use of Custom Fields.  We have just discovered that while our website displays the correct pricing on the product details page, it has stopped charging for the extended warranties once you reach the cart where the extra cost of the extended warranty is left out.

We have eventually found the issue appeared in version 3.4.5, in the helpers/cart.php file in function prepareCartData, when the following changes have happened:
This line was removed
$customFieldsModel = VmModel::getModel('customfields');
The following line has also been commented out. 
$product->customfields = $customFieldsModel->getCustomEmbeddedProductCustomFields($product->allIds,0,1);

Once these lines are put back the cart starts working with the correct prices again. 

These changes seem to apply in every version of Virtuemart since 3.4.5. 

We can't find any documentation on why this changes was made, much less the big problems it has caused.  Can anybody enlighten us as to why these lines were removed and if it is possible to get this fixed in future versions, or at least find some other way to prevent the cart losing the pricing from the custom fields?  As it is a core file any fixes we apply are going to get overridden when we update again.

Thanks

jjk

It was changed in VirtueMart build number 10025. See here:
http://dev.virtuemart.net/projects/virtuemart/repository/revisions/10025/diff/trunk/virtuemart/components/com_virtuemart/helpers/cart.php
But I don't know the reason for this change either.

Perhaps test if you can override the file by placing a copy in a subfolder of your template's html folder, like: ...\your-template\html\com_virtuemart\cart
And then uncomment the line in the override.
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

gowifi

No,  I don't think we can override a helper with a template override, and we wouldn't really want to as any other fixes/updates from Virtuemart that are done in the helper in future versions would be overridden.  We'd end up having to update our file every time which is the issue we are already in.

Where would be the appropriate place for us to suggest restoring those lines in the file in a future version?

Thanks

Milbo

I wonder, which version do you use now? a template override cant fix it, right. It got commented, because it should be done before already. I hope you know, that you can always install the latest version directly.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

gowifi

We are currently using version 3.6.10 build 10211 and the problem persists in that version.

We have manually updated the code in the helper file for now, but it sounds like we should probably be submitting a ticket for this to be fixed in future versions?

jjk

Note that both lines are still present in the file cart.php, but at different positions (moved upwards).
Perhaps you test with a copy of your live site if the latest VM 3.6.11 beta solves your problem?
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

jjk

Note that both lines are still present in the file cart.php, but at different positions (moved upwards). Does it return in the cart view after you saved the custom field again?
Perhaps you can test with a copy of your live site if the latest VM 3.6.11 beta solves your problem?
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

gowifi

We have tried version 3.6.11 (build 10251) and can confirm the problem still exists in that version.

Saving again doesn't make any difference, the problem still persists.

If you add the lines back in and refresh the cart page the product prices update correctly, if you take them back out they immediately disappear again.

AH

Show your configuration

Are these default base VM customfields or using a  third party plugin?
Regards
A

Joomla 4.4.5
php 8.1

gowifi

The Extended Warranty field we have is using the Custom Fields for All (4.0.6) plugin

AH

Do not bother submitting tickets as Customfield plugins provided by Virtuemart team work as expected and have been extensively tested by the team.

I suggest talking to the developers of that customfield plugin
If that is not the issue then if you use a third party checkout plugin.

And post a link to your site Front End - because working in the dark is not that simple.

Regards
A

Joomla 4.4.5
php 8.1