Home › Forums › WoodMart support forum › Code to format product variation dropdown
Code to format product variation dropdown
- This topic has 23 replies, 2 voices, and was last updated 1 month ago by Aizaz Imtiaz Awan.
-
AuthorPosts
-
October 3, 2024 at 6:41 pm #602318
churchworksParticipantHello, I’m trying out a plugin from Iconic called Woocommerce Linked Variations which creates a path to link single products together as if they were variations. Iconic promises “theme compatibility.” The plugin does seem to work well. However, the default formatting offered by the Woodmart theme is pretty bad. I’ve attached some screenshots. I’ve also added info to view the element live on our staging site.
Attachments:
You must be logged in to view attached files.October 4, 2024 at 1:29 pm #602519
Aizaz Imtiaz AwanKeymasterHello,
Add below Custom CSS code to Theme Settings > Custom CSS > Global custom CSS:
td.iconic-wlv-variations__label, td.iconic-wlv-variations__value { border-bottom: none !important; } .iconic-wlv-terms { margin: -20px 0 -10px; padding: 12px; width: 200px; }
But you can use the linked variation feature without a plugin. This feature is available in the theme.
Please follow this guide:
https://xtemos.com/docs-topic/linked-variations/Best Regards
October 4, 2024 at 6:36 pm #602614
churchworksParticipantThank you, this looks much better! The format is unfortunately shown twice (see attached screenshot)—next to the “Format:” label and again in the dropdown menu (see attached screenshot). Is it possible to move the dropdown picker up next to the “Format:” label?
I did try the theme’s built-in Linked Variations, but I don’t particularly like the formatting options. If Woodmart also had the option to display linked variations as a dropdown menu, I would certainly consider that.
Attachments:
You must be logged in to view attached files.October 5, 2024 at 10:32 am #602691
Aizaz Imtiaz AwanKeymasterHello,
Add the below Custom CSS code to Theme Settings > Custom CSS > Global Custom CSS.
span.iconic-wlv-variations__selection { display: none; } td.iconic-wlv-variations__label, td.iconic-wlv-variations__value { display: inline-block; }
Best Regards
October 22, 2024 at 5:47 pm #606884
churchworksParticipantThank you! So far the code works great for simple products. When I added a variable product to the dropdown list, the formatting broke (see attached screenshot). Is there an adjustment to the code that would keep the “Format” dropdown inline for variable products as well?
Attachments:
You must be logged in to view attached files.October 23, 2024 at 9:01 am #606957
Aizaz Imtiaz AwanKeymasterHello,
Can you please share the product page URL so I will check and give you a possible solution?
Best Regards
October 23, 2024 at 3:21 pm #607112
churchworksParticipantYes, I’m trying this out on our staging site. URL and credentials shared privately below.
October 24, 2024 at 11:44 am #607297
Aizaz Imtiaz AwanKeymasterHello,
Add the below Custom CSS code to Theme Settings > Custom CSS > Global Custom CSS.
.variations td.iconic-wlv-variations__label, td.iconic-wlv-variations__value { display: inline !important; } table.variations { margin-bottom: 20px !important; }
Best Regards
October 24, 2024 at 11:42 pm #607481
churchworksParticipantWe’re so close! Just one more adjustment needed to remove the duplicate format label (see attached). Thanks!
Attachments:
You must be logged in to view attached files.October 25, 2024 at 12:05 am #607483
churchworksParticipantAnother oddity on the variable product—there is extra space between “Format” and “:” (see attached screenshot).
Attachments:
You must be logged in to view attached files.October 25, 2024 at 3:46 am #607494
churchworksParticipantI’ve been adjusting the CSS to get the Iconic dropdown menu looking just how I want. But I’m utterly baffled at why it behaves differently for Variable products. The only thing I can think of is that if Iconic built the plugin specifically for Simple products, there may be something in the plugin code preventing the plugin from displaying properly on Variable products.
If you guys can find a solution (or perhaps a way to separate the CSS that’s applied to Simple vs. Variable products), that would be exciting! But if the solution goes beyond the scope of theme support, I’d understand.
Here is my modified CSS…which looks great on the Simple products I’m testing:
td.iconic-wlv-variations__label, td.iconic-wlv-variations__value { border-bottom: none !important; display: inline block; margin-left: -12px; color: #282A2D; } span.iconic-wlv-variations__colon { padding-left: 2px; font-weight: bold; } .iconic-wlv-terms { margin: -20px -10px -15px; padding: 12px; width: 120px; } span.iconic-wlv-variations__selection { display: none; } .variations td.iconic-wlv-variations__label, td.iconic-wlv-variations__value { display: inline !important; color: #282A2D !important; } .variations td.iconic-wlv-variations__selection { display: none; } table.variations { margin-top: 30px; margin-bottom: 30px !important; }
October 25, 2024 at 10:38 am #607536
Aizaz Imtiaz AwanKeymasterHello,
Add below Custom CSS code to Theme Settings > Custom CSS > Global custom CSS:
table.variations .label span { display: none; } table.variations { margin-top: 10px !important; }
Best Regards
October 30, 2024 at 10:39 pm #608857
churchworksParticipantHello, thank you for the code. It helped me reach a passable level of formatting for the plugin.
At last, I am trying to add space below (and above) the Iconic plugin dropdown, but only for simple products. I can’t seem to figure out the CSS to do so (see screenshot). Any ideas would be appreciated. Thanks!
Attachments:
You must be logged in to view attached files.October 31, 2024 at 11:15 am #608920
Aizaz Imtiaz AwanKeymasterHello,
Can you please share the product page URL so I will check and give you a possible solution?
Best Regards
October 31, 2024 at 3:00 pm #609027
churchworksParticipantYes, please see url and login credentials in private content.
October 31, 2024 at 4:35 pm #609078
Aizaz Imtiaz AwanKeymasterHello,
Add the below Custom CSS code to Theme Settings > Custom CSS > Global Custom CSS.
.single-product .product-type-simple .variations { margin-top: 40px !important; margin-bottom: 40px !important; }
Best Regards
November 2, 2024 at 4:50 am #609368
churchworksParticipantThank you again for the code. This did the trick! I’m happy with how it looks.
In case anyone else goes looking for this, here is the CSS I used to format the Iconic Linked Variations dropdown within the Woodmart theme—particularly getting it to match the theme’s product variations dropdown:
td.iconic-wlv-variations__label, td.iconic-wlv-variations__value { border-bottom: none !important; display: inline !important; margin-left: -12px; color: #282A2D; } .iconic-wlv-terms { margin: -20px -5px -15px; padding: 12px; width: 140px; color: #5d5d5d } .variations td.iconic-wlv-variations__label, td.iconic-wlv-variations__value { color: #282A2D !important; } table.variations .label span { display: none; } table.variations { margin-top: 28px !important; } .single-product .product-type-simple .variations { margin-top: 35px !important; margin-bottom: 35px !important; }
Note: This bit of necessary code (from above) removes the colon (:) from the dropdown label (product attribute), which looks odd, so I just added a colon to the attribute name (not ideal, but it works):
table.variations .label span { display: none; }
November 2, 2024 at 9:57 am #609381
Aizaz Imtiaz AwanKeymasterHello,
Great, we are glad that you sorted it out. Feel free to contact us if you have any further questions.
Best Regards
November 8, 2024 at 7:41 pm #610908
churchworksParticipantWell, I’m back. This time, I need to adjust space around the dropdown for External/Affiliate products. (screenshot attached; product link in private content) Thanks!
Attachments:
You must be logged in to view attached files.November 9, 2024 at 9:04 am #610971
Aizaz Imtiaz AwanKeymasterHello,
Add the below Custom CSS code to Theme Settings > Custom CSS > Global Custom CSS.
.single-product form.cart{ margin-top: 50px !important; }
Best Regards
November 13, 2024 at 8:42 pm #611981
churchworksParticipantHi, that bit of code was not the solution I need, but I figured it out (using .product-type-external)!
HOWEVER, I have another request: when one or more products are External/Affiliate products, they show up in the linked variations dropdown as “Unavailable” (see attached screenshot). Is there a way to hide the “Available/Unavailable” product labels in this dropdown?
Attachments:
You must be logged in to view attached files.November 14, 2024 at 10:56 am #612092
Aizaz Imtiaz AwanKeymasterHello,
Sorry, but there is no option available for that in Theme Settings.
It requires customizations and this is beyond our limitations and support policy.
Best Regards
November 14, 2024 at 2:26 pm #612144
churchworksParticipantNo problem. Thanks for all the help!
November 14, 2024 at 3:18 pm #612167
Aizaz Imtiaz AwanKeymasterMost Welcome!!!.
I’m so happy to hear you are pleased with the Theme and Support. XTEMOS strives to deliver the best customer experience, and it makes our day to hear we have accomplished that.
We count ourselves lucky to have you as a customer. You can always reach us at any time. We are always here to help you.
Thanks for contacting us.
Have a great day.Topic Closed.
Best Regards. -
AuthorPosts
The topic ‘Code to format product variation dropdown’ is closed to new replies.
- You must be logged in to create new topics. Login / Register