Skip Navigation

[Résolu] Product Addons not displaying for simple products

This support ticket is created Il y a 7 années. 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.

Aucun de nos assistants n'est disponible aujourd'hui sur le forum Jeu d'outils. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

Marqué : 

Ce sujet contient 10 réponses, a 2 voix.

Dernière mise à jour par Nigel Il y a 6 années et 4 mois.

Assisté par: Nigel.

Auteur
Publications
#590103

Hi,

I am using WooCommerce combined with WP Types and Views and Woocommerce views in order to display products and I am trying to add an add-on to all the products. I am using the woocommerce product addons plugin, however the "notes" textfield I am trying to add, only comes up for the variable products and not the simple ones.

You can view it here: lien caché

The view displays the product then the following inside an inline lightbox:

<div id="[wpv-post-id]-options" class="hentry" style="width:460px;max-width:100%;">
            [wpv-conditional if="( '[wpv-post-featured-image size='large' output='url']' ne '' )"]
              <div class="wto_header_img" style="background-image: url([wpv-post-featured-image size='large' output='url']);">
            [/wpv-conditional]
          	[wpv-conditional if="( '[wpv-post-featured-image size='large' output='url']' eq '' )"]
              <div class="wto_header_img noimg">
            [/wpv-conditional]
                <div class="overlay"></div>
              </div>
              <div class="wto_details">
                <div class="wto_title">[wpv-post-title]</div>
                <div class="description">
                	[wpv-post-excerpt]
                </div>
                [wpv-woo-buy-or-select add_to_cart_text='' link_to_product_text='' group_add_to_cart_text='' external_add_to_cart_text='' show_quantity_in_button='yes' show_variation_options='yes']
              </div>

I might be missing a few closing tags, but rest assured the actual code running on the website is correct.

#590155

Nigel
Supporter

Les langues: Anglais (English ) Espagnol (Español )

Fuseau horaire: Europe/London (GMT+00:00)

Hi Adrian

I tested this on a local site and saw no difference between simple and variable products, the add-on field showed on both.

So I think I will need to see this on your site to check how you have done this.

I will mark your next reply as private so that I can get log-in credentials from you—you may want to create a temporary admin user for me to use that you can later delete. And be sure to have a current backup of your site, even though I don't intend to make any changes other than—possibly—to temporarily add a backup plugin to take a snapshot of the site.

#590585

Nigel
Supporter

Les langues: Anglais (English ) Espagnol (Español )

Fuseau horaire: Europe/London (GMT+00:00)

Hi Adrian

I logged in with the credentials you provided but I don't have backend access. If I try to visit /wp-admin/ I'm redirected to a front-end account dashboard.

#591052

Hi sorry, the account did not have admin access. You should now be able to get in.

Thank you

#591255

Nigel
Supporter

Les langues: Anglais (English ) Espagnol (Español )

Fuseau horaire: Europe/London (GMT+00:00)

Hi Adrian

Thanks for that, I've now been able to access your site and identify the issue.

In my tests I had been testing the ad-ons with a template for single products, where it works the same for both simple and variable products.

In a View or archive where you use the wpv-woo-buy-or-select shortcode the expected behaviour is different for simple or variable products, as described in its documentation: https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-woo-buy-or-select.

WooCommerce extensions typically work by hooking into some actions triggered by WooCommerce. When you use Views to produce customised WooCommerce output the same actions may not be triggered, depending on the particular circumstances of what you add where.

In this case it seems that the required action is triggered with the variable products workflow, but not that for single products.

I am escalating this thread to see if it is possible to update the workflow used with wpv-woo-buy-or-select so that it triggers the action required by the WooCommerce Product Add-ons extension.

I'll update you when I have any news.

#591358

Hi Nigel,

Thank you. In the meantime I have another question:

With Ajax enabled, it only works for single products. Variable Products need to refresh the page.
Is there a way to have Ajax add to cart for both simple and variable products within a View?

Thank you

Adrian

#591370

Found it. Turns out Woo-commerce did not have that by default. You need a plugin to enable it. Very strange...

#626305

Hi Nigel,

I am trying to use Gravity Forms to add a notes field. It shows up on the variable products in the loop, but not on simple products.

You mentioned you would look into triggering the add-ons to show up with the WooCommerce Product Add-ons extension (thinking gravity forms puts their forms in the same way.

Adrian

#626851

Nigel
Supporter

Les langues: Anglais (English ) Espagnol (Español )

Fuseau horaire: Europe/London (GMT+00:00)

Thanks for that, Adrian, I've added that to the internal ticket.

#627549

Thank you. Can you please keep this ticket open and let me know when there is a solution available. Thank you

Adrian

#954346

Nigel
Supporter

Les langues: Anglais (English ) Espagnol (Español )

Fuseau horaire: Europe/London (GMT+00:00)

Hi Adrian

It has been a while but our lead developer took a long look at this and provided a lengthy explanation as to why we are not able to resolve this issue.

I could paste his feedback, but the short answer is that we cannot resolve it. The only viable solution could have unintended consequences for a myriad of other 3rd party plugins which is a Pandora's box we don't want to open.

I'm sorry we don't have a solution this time.