News:

Support the VirtueMart project and become a member

Main Menu

Activating + - quantity adjustment when adding to cart

Started by zoki_ma, March 25, 2019, 15:04:50 PM

Previous topic - Next topic

zoki_ma

Hi everyone, I'm back with another question.

Site that I manage has the following:

Joomla! 3.8.7 Stable
VirtueMart 3.2.4
Template: TP Runway (I think)
Overrides: not sure if there are any, where to check?
PHP Version 7.0.33
Database Version    5.5.5-10.1.38-MariaDB
Using SEF links: YES

Problem that I have now is that site doesn't have the + - quanity adjustment so that shoppers can add more than 1 item to cart.
Here's an example product:
https://www.masiva-bj.hr/index.php/proizvodi/rezervni-dijelovi-za-traktore/imt-577-578/motor/5001702-detail.html

I've googled the issue and there's plenty of topics where people ask for help removing this feature. That's what must have been done here.

I found this code:


<div class="center">
<label for="quantity32871" class="quantity_box">Količina: </label>
<div class="quantity-area">
<span class="quantity-box">
<input type="text" class="quantity-input js-recalculate" name="quantity[]" readonly
data-errStr="Ovaj proizvod je moguće kupiti samo u paketu od %s komada."
value="1" init="1" step="1"  />
</span>
<span class="quantity-controls js-recalculate">
                                            <input type="button" class="quantity-controls quantity-plus" value="&plus;"/>
                                            <input type="button" class="quantity-controls quantity-minus" value="&minus;"/>
</span>                                       
</div>


Usually it's done through CSS and whatnot. I checked around 20 template overrides and CSS files and I couldn't find that sweet "display: none" option anyone. I did find a few, but none of them are hiding these controls.

Is there some painfully obvious configuration toggle within Virtuemart itself that's hiding this feature? Cause I looked for that as well but I couldn't find any.

Do I need to install third party plugins?

Thank you in advance for your help.

jenkinhill

Quote from: zoki_ma on March 25, 2019, 15:04:50 PM
Template: TP Runway (I think)

You think?? The template used will be should named under Joomla Extensions/Templates  - some "developers" rename commercial templates to their own chosen name which is no help.

Quote
Overrides: not sure if there are any, where to check?

It is obvious that overrides are used - compare product details page with (for example)  http://demo.virtuemart.net/cap-baseball-detail

The override files should be found in Joomla root/templates/your-joomla-template/html/com_virtuemart/

The quantity change selector is part of the add to cart bar sublayout.  The default files should be at Joomla root/components/com_virtuemart/sublayouts/addtocartbar.php  but it is obviously overridden, the override file  should be found at   Joomla root/templates/your-joomla-template/html /com_virtuemart/sublayouts/addtocartbar.php  This override file has had the quantity change removed or commented out.

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

zoki_ma

Quote from: jenkinhill on March 25, 2019, 15:30:34 PM
some "developers" rename commercial templates to their own chosen name which is no help.

That's exactly the case here, the template currently in use is called "masiva" which is the name of the store. I looked through the files and found an image, banner of sorts, which is a TP Runway promo, that's why I said that I think that's the template used.

Quote from: jenkinhill on March 25, 2019, 15:30:34 PM
This override file has had the quantity change removed or commented out.

Quantity selector was disabled in CSS, there was a div containing it that had "display: none" set. Trouble is that this CSS file was located in templates/masiva/local/css/themes/masiva/template.css. I read through the forum and found your suggestion of using Agent Ransack program to find files, and that's  how I managed to find this file. Not sure if putting stuff in that file is standard practice, but that's how people who put the shop together did it.

The only trouble now is that the buttons aren't visible on mobile apps. But I'm not sure that they are even needed there to be honest.

Thanks for the hlep.