Sauter la navigation

[Résolu] Can the woocommerce button on the search results share the same styling as the button on the product page?

This support ticket is created Il y a 6 années et 1 mois. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

Ce sujet contient 1 réponse, a 2 voix.

Dernière mise à jour par Luo Yang Il y a 6 années et 1 mois.

Assisté par: Luo Yang.

Auteur
Publications
#1180646

Hi Luo,

I'm trying to determine why the "Add the cart" button on the following page: lien caché

is not the same as the "Add to Cart" button on the following product pages lien caché

Can the woocommerce button on the search results share the same styling as the button on the product page?

#1180649

Hello,

I assume we are talking about [wpv-woo-buy-or-select] in a post view, this shortcode will output a HTML a link tag, for example:

<a href="..." class="button product_type_simple add_to_cart_button ajax_add_to_cart single_add_to_cart_button button alt" ... >Add to cart</a>

https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-woo-buy-or-select

But in single product post, the "Add to cart" HTML codes is using different button HTML codes, for example:

<button type="submit" name="add-to-cart" value="16051" class="single_add_to_cart_button button alt">Add to cart</button>

So they do not share the same styles by default.

In your case, you can try to style the HTML A link tags manually, for example:

a.add_to_cart_button{
/* here put your custom CSS codes */
}