Welcome, Guest
Username: Password: Remember me
Use this Category for your support questions about Virtuemart Template - CleanMart (SKU# FLEX-00015)

TOPIC: Tutorial 3: Modification for VM Custom, Stockable

Tutorial 3: Modification for VM Custom, Stockable 10 years 5 months ago #6748

UPDATED on August 2nd

For those who are willing to use VM Custom, Stockable Variants, then you should do this small modification.
(otherwise you won't see awesome add to cart button)

Open this PHP file:
/plugins/vmcustom/stockable/stockable.php

Look for this line (around 403rd line):
$(".addtocart-bar").append(\'<span class="quantity-box"><input type="text" class="quantity-input js-recalculate" name="quantity[]" value="\' + quantity + \'" /></span><span class="quantity-controls js-recalculate"><input type="button" class="quantity-controls quantity-plus" /><input type="button" class="quantity-controls quantity-minus" /></span><span class="addtocart-button"><input type="submit" name="addtocart" class="addtocart-button" value="'.JText::_('COM_VIRTUEMART_CART_ADD_TO').'" title="'.JText::_('COM_VIRTUEMART_CART_ADD_TO').'" /></span><div class="clear"></div>\');

and replace it with this:
$(".addtocart-bar").append(\'<div class="FlexibleCSS3Button"></div>\');
$(".FlexibleCSS3Button").append(\'<span class="FlexibleCSS3ButtonInner"></span><span class="FlexibleCSS3ButtonQuantity"></span>\');
$(".FlexibleCSS3ButtonInner").append(\'<input type="submit" name="addtocart" value="'.JText::_('COM_VIRTUEMART_CART_ADD_TO').'" title="'.JText::_('COM_VIRTUEMART_CART_ADD_TO').'" class="addtocart-button FlexibleCSS3Button-text"><span class="FlexibleCSS3Button-symbol"></span><span class="FlexibleCSS3Button-slide-icon"></span>\');
$(".FlexibleCSS3ButtonQuantity").append(\'<span class="quantity-controls js-recalculate FlexibleMinus"><input type="button" class="quantity-controls quantity-minus"></span><span class="quantity-box FlexibleInput"><input type="text" value="\' + quantity + \'" onblur="check(this);" name="quantity[]" class="quantity-input js-recalculate"></span><span class="quantity-controls js-recalculate FlexiblePlus"><input type="button" class="quantity-controls quantity-plus"></span>\');

And you will be good to go.
You would need to do this coding modification each time you update your Virtuemart.

Regards,
Support & Development
Last Edit: 9 years 7 months ago by Support.
The administrator has disabled public write access.

Tutorial 3: Modification for VM Custom, Stockable 9 years 10 months ago #9846

Hi,

This isn't working for me ... Without the above mod I can see the variants, but when I add the code it shows the button OK, but not all variants - like the attached pic.

Here's the site
J2.5.14
VM 2.6.0a
CleanMart v1.3

Any help would be greatly appreciated.
Attachments:
Last Edit: 9 years 10 months ago by Rob. Reason: Added version info
The administrator has disabled public write access.

Tutorial 3: Modification for VM Custom, Stockable 9 years 10 months ago #9861

Hi,

I am seeing it is working fine.

Probably it wasn't working at first, because you had to re-fresh the cache.

(after making any code changes in any PHP file, you need to refresh the cache, or wait around 10-15 minutes to see the changes in the front-end)

Regards.
Support
The administrator has disabled public write access.

Tutorial 3: Modification for VM Custom, Stockable 9 years 10 months ago #9864

When the code is changed in stockable.php, it doesn't show the custom field options - here's an example product. Without the mod, it works fine ...?
The administrator has disabled public write access.

Tutorial 3: Modification for VM Custom, Stockable 9 years 10 months ago #9871

Hi,

I found one quotation mistake in the replacement codes and i fixed it. Can you try again?
I updated the 1st post.


Regards,
Support
Last Edit: 9 years 10 months ago by Support.
The administrator has disabled public write access.

Tutorial 3: Modification for VM Custom, Stockable 9 years 10 months ago #9876

Yes, nearly there ... the animated arrow now appears to be floating towards the top of the container div. It's been working fine on other non-stockable variant products.

Thanks for all your help with this.
Last Edit: 9 years 10 months ago by Rob. Reason: link not added
The administrator has disabled public write access.

Tutorial 3: Modification for VM Custom, Stockable 9 years 10 months ago #9883

Sorry for the back-n-forward troubles. I noticed that, when i fixed the initial quotation problem, i have made an another mistake, (forgot to close the <div> element in the middle)

I just updated the replacement lines, also tested them in our Live Demo to make sure they are working.
The new replacement codes are working, tested and confirmed.

But you know... we are all human-beings, so error/mistake can happen anytime ;)
if still there is a problem, let me know. I will take a look at it again.

Regards,
Support
Last Edit: 9 years 10 months ago by Support.
The administrator has disabled public write access.

Tutorial 3: Modification for VM Custom, Stockable 9 years 10 months ago #9907

Wahey!! ... You are SUPER HUMAN ;-)
The administrator has disabled public write access.

Tutorial 3: Modification for VM Custom, Stockable 9 years 10 months ago #9924

;) i am glad it works now.

Regards,
Support
The administrator has disabled public write access.

Tutorial 3: Modification for VM Custom, Stockable 9 years 9 months ago #10116

Hello,

I can't find the code in the stockable.php


I have found only the following:
$(".addtocart-bar").append("<div class="FlexibleCSS3Button "><span class="FlexibleCSS3ButtonInner"><input type="submit" name="addtocart" class="addtocart-button  FlexibleCSS3Button-text" value="'.JText::_('COM_VIRTUEMART_CART_ADD_TO').'" title="'.JText::_('COM_VIRTUEMART_CART_ADD_TO').'" /><span class="FlexibleCSS3Button-symbol"> </span><span class="FlexibleCSS3Button-slide-icon"> </span></span><span class="FlexibleCSS3ButtonQuantity"><span class="quantity-controls js-recalculate FlexibleMinus"><input class="quantity-controls quantity-minus" type="button"></span><span class="quantity-box FlexibleInput"><input type="text" class="quantity-input js-recalculate" name="quantity[]" value="\' + quantity + \'" /> </span><span class="quantity-controls js-recalculate FlexiblePlus"><input class="quantity-controls quantity-plus" type="button"></span></span></div><div class="clear"></div>");
The administrator has disabled public write access.

Tutorial 3: Modification for VM Custom, Stockable 9 years 9 months ago #10128

Hi Ramona Zühlsdorf.

Apparently you have already done that. Or you are using one of our Template:
- Asymmetric
- LightMart
- DarkMArt
- StyleMart

and performed the "QuickStart" package installation. with the QuickStart package installation, that coding modification comes pre-applied. That topic is valid only for those who use CleanMart.

FYI: You don't need to do anything, it has been taken care already.

Regards,
Support
The administrator has disabled public write access.
Time to create page: 0.203 seconds

MaterialMart

for Virtuemart 3

Google's Material Design has finally arrived to Virtuemart

Virtumart Template - MaterialMart Virtumart Template - CleanMart Virtumart Template - CleanMart Virtumart Template - CleanMart

Fully responsive!

Buy Now   |   Live Demo