News:

Support the VirtueMart project and become a member

Main Menu

Attributes of item purchased showing customer picked all but they cant

Started by Banzelcroftcustoms, July 09, 2019, 07:39:53 AM

Previous topic - Next topic

Banzelcroftcustoms

I am using vm 3.4.2. on Joomla 3.9.8 but have had this issue since the start of my website roughly 1 to 2 years ago but only happens occasionally.

I am a knife maker so when you purchase a knife there are 3 drop down boxes you can pick 1 add on from each.
Sheath color : black or brown
Jimping : add or don't add
Belt attachment : add or don't add

I'm not sure what is happening on the front end with the customer to cause this but on the backend, there are times it shows me they chose all 6 options. Being both sheath colors, yes and no to jimping, yes and no to the belt attachment.

The price reflects what they got but since the attachment and jimping are both the same add on price, I can't just guess which one they chose. And for the sheath color it showing they chose black and brown, forces me to email them and ask as well.

I am not an expert at web coding and use a simple template and virtuemart but other than that, I don't have any special code I have added to my site. My knowledge is rather limited in that regard so I don't think I messed anything up that way. I'm wondering if the customer is timing out and coming back? I really have no idea. I attached an image of the backend to show you how it looks for me.

My url www.banzelcroftcustoms.com

Mykel

Jörgen

Hello

This happens when You add the item from the category page. I thought I had seen the ability to turn the addtocart button off in configuration, but can not find it. You can however remove the addtocart button in the template file.

Make an override of the products.php
and change:
defined('_JEXEC') or die('Restricted access');

to
defined('_JEXEC') or die('Restricted access');
$view = vRequest::get('view');[/code]

And change approx line 127
echo shopFunctionsF::renderVmSubLayout('addtocart',array('product'=>$product,'rowHeights'=>$rowsHeight[$row], 'position' => array('ontop', 'addtocart'))); ?>

to
if ($view =="productdetails")
echo shopFunctionsF::renderVmSubLayout('addtocart',array('product'=>$product,'rowHeights'=>$rowsHeight[$row], 'position' => array('ontop', 'addtocart'))); ?>


That removes addtocart in the category view.

These lines are not tested, I use a different override, but with similar result.

Jörgen @ Kreativ Fotografi


Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

Banzelcroftcustoms


Banzelcroftcustoms

I am unsure of where to find this product.php section. I went to templates and clicked on "editor" , "create overrides" , "template description" and I am not seeing where there is product.php.

I apologize for my inexperience with this.
Mykel

Jörgen

You have to create the override com_virtuemart and then choosing sublayouts. Then I think you can edit the sublayout products.php. you can also copy only the products.php to your-template/html/com_virtuemart/sublayouts. There are olnty of examples in the forum how to make an override in the event that I have made some small typo.
Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

jenkinhill

You cannot make sublayout overrides using Joomla's Create Overrides editor.

To create a sublayout override you should use ftp to first set up a suitable override folder, joomlaroot/templates/protostarplus/html/com_virtuemart/sublayouts/  - it looks like you already use overrides, so this folder may already exist, if not then create it.

If there are already sublayout overrides then look for products.php in that directory and download it for editing in a suitable plain text editor such as NoteTab. if there is not already a products.php file then download the products.php file in joomlaroot/components/com_virtuemart/sublayouts/

In either case edit the file to remove  (or comment out)  the div containing

<div class="vm3pr-<?php echo $rowsHeight[$row]['customfields'?>"> <?php
echo shopFunctionsF::renderVmSubLayout('addtocart',array('product'=>$product,'rowHeights'=>$rowsHeight[$row], 'position' => array('ontop''addtocart'))); ?>

</div>

Note this is the code in the current VM version default template.

Save the edited file and ftp into your template override folder.  That should fix it.
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Jörgen

@jenkins In this case the addtocart button should only be removed from the category page. Hence my code. Just commenting the line is not enough.

Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

jenkinhill

Soory Jörgen, but no, for productdetails the addtocart sublayout is called direct from components/com_virtuemart/views/productdetails/tmpl/default.php  so my override does not remove add to cart from the product pages.  I think this is what the OP needs.
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Jörgen

@jenkins I stand corrected, You are right. This makes my solution a bit more complicated than necessary.

best regards

Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.