| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
How to display color name when swatch is chosen | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
How to display color name when swatch is chosen
I already owned the color swatch mod for xcart 5, however I have a question, how do I display color name when swatch is chosen so that it will show next to the "color" attribute? See attachment for sample
When it is in mobile, people cannot see the selected color from the "popover" . Do I change the CSS file or the js script? Any suggestions? Thanks
__________________
JOHN - v.5.3.X biz, X-payment 3.X |
|||||||
#2
|
|||||||||
|
|||||||||
Re: How to display color name when swatch is chosen
You could use 'Custom JS', perfectly suits this task.
__________________
Alex Solovev, Qualiteam --- User manual Video tutorials X-Cart FAQ You are welcome to press "Thanks" button if you find this post useful Click here to learn how to apply patches X-Cart Extensions |
|||||||||
#3
|
|||||||
|
|||||||
Re: How to display color name when swatch is chosen
Quote:
I put this in the colorswatch/controller.js jQuery(function(){ $(".color-swatches input[type=radio]:").change(function(){ jQuery('.active-color').text($(".color-swatches input[name^="attribute_values"]:checked").val()); }) }) the following in colorswatch/body.twig <span class ="active-color"></label>
__________________
JOHN - v.5.3.X biz, X-payment 3.X |
|||||||
#4
|
|||||||
|
|||||||
Re: How to display color name when swatch is chosen
Or if there's any other solutions , basically user complains about not able to see the color option when using mobile. See the attached pic.
If we can use tooltips or if there's a way to enlarge the "caption box"? I cannot find anything from the css file and the xcart techsupport will not help without any payment. Thanks.
__________________
JOHN - v.5.3.X biz, X-payment 3.X |
|||||||
#5
|
|||||||||
|
|||||||||
Re: How to display color name when swatch is chosen
Ok, I've done the following (the better way than JS).
1. Added the following method to XLite/Module/QSL/ColorSwatches/View/Product/AttributeValue/Customer/Select.php PHP Code:
Code:
just after this line Code:
And I got the following (screenshot attached). You can play with CSS a bit to make it look different, but the idea is here.
__________________
Alex Solovev, Qualiteam --- User manual Video tutorials X-Cart FAQ You are welcome to press "Thanks" button if you find this post useful Click here to learn how to apply patches X-Cart Extensions |
|||||||||
#6
|
|||||||
|
|||||||
Re: How to display color name when swatch is chosen
Thank you very much for your help. The <h6> tag should be right after
{{ this.getModifierTitle(v)|raw }}
__________________
JOHN - v.5.3.X biz, X-payment 3.X |
|||||||
#7
|
|||||||||
|
|||||||||
Re: How to display color name when swatch is chosen
Quote:
That's correct. But please remember that you should apply any changes to PHP code as a module, otherwise it will be overwritten during the next update of the cart (or the module in this particular case). What I posted is just an example.
__________________
Alex Solovev, Qualiteam --- User manual Video tutorials X-Cart FAQ You are welcome to press "Thanks" button if you find this post useful Click here to learn how to apply patches X-Cart Extensions |
|||||||||
|
|||
X-Cart forums © 2001-2020
|