
-
AuthorPosts
-
February 26, 2022 at 3:19 pm #1342380
we found a problem with the last theme update 4.8.7.1,
the problem: sku in the product details page disappeared.(both in simple and configurable product)
in the old version 4.8.1 (currently in production) you see the sku in the product page without any problem. Also in dev (where we updated the theme) If we configure back the 4.8.1 in the dev, you can see that the sku appears again
but with the updated enfold theme 4.8.7.1 we can’t see the product sku anymore. So we assume that it’s a problem with the theme update. Could you please help us with this?
February 26, 2022 at 5:01 pm #1342389Hey tgasoftware,
Thanks for the login details. Does the same problem happen if you update to the latest version (4.9) of the theme as well?
Best regards,
RikardMarch 3, 2022 at 5:07 pm #1343032Hi Rikard
yes, we updated the theme and verified that the same happens with the latest version 4.9 of the theme (currently active in dev site)regards
March 4, 2022 at 12:54 pm #1343117Hi,
Thanks for the update. I can’t reproduce the problem on a test installation, as you can see here: https://wpexpert.se/enfold/product/test-product/
I see that you are using the Layout Builder to create your product though, and that means that everything needs to be added manually to the product. Did you try the Product Meta Info element?
Best regards,
RikardMarch 4, 2022 at 3:12 pm #1343161thanks for your tests. What is strange is that if i use the theme in it’s version 4.8.1 (you can change it without any problem for test in our dev environment) and maintaining all with exactly the same wordpress configuration (layout builder, plugins, etc) you’ll see that it works perfectly. The problem occurs only when we update the theme.
March 4, 2022 at 7:55 pm #1343197Hi,
Thanks for the update. I installed 4.8.1 on the test site, but I’m seeing the same behaviour in both versions; when the default editor is active, then the SKU will appear automatically, but it won’t when the Layout Builder is active. That behaviour is as designed. Maybe you had some custom code in the parent theme which was overwritten during the update?
Enfold 4.8.1 is active here: https://wpexpert.se/enfold/product/test-product/
Best regards,
RikardMarch 4, 2022 at 10:28 pm #1343217Hi Rikard, thanks for your support. That’s right: when disabling the Layout Builder, the sku appears! (but losses all the styles) . Then it seems a problem related with the Layout Builder.
Maybe you had some custom code in the parent theme which was overwritten during the update?
In fact we don’t have any customization, neither a parent theme, (we are using the enfold 4.9 directly )You could check in our dev site, now with the theme 4.8.1 active, how the sku is showed even with the layout builder active.
March 5, 2022 at 10:46 am #1343240Hi,
Thanks for the update. I can’t see the SKU on my end on your dev site, please see screenshot in private.
Best regards,
RikardMarch 5, 2022 at 1:50 pm #1343251Hi Rikard, as this is a variable product and you didn’t selected any option, it shows “N/D” as sku, but if you select an option you’ll see the sku . thanks
March 5, 2022 at 3:31 pm #1343252Hi,
Thank you for your patience, when I compare your two versions 4.8.1 & 4.9
I see that your v4.8.1 has a lot of custom functions in the parent theme functions.php and a lot of custom css in the parent theme /css/custom.css
these are not in the 4.9 version, so it is not going to look the same, for example you have a custom footer widget in the v4.8.1 which is not in the 4.9 version.
Please see the screenshot in the Private Content area of the two pages side by side, perhaps there are other modifications made that you forgot about that is affecting the sku?Best regards,
MikeMarch 5, 2022 at 5:09 pm #1343259Hi Mike, thanks for your help. I understand your point, but v4.8.1 theme is working fine even with these modifications showing skus. Footer widgets i understand that are not showing because theme change (we can add it without any problem). But the problem is with theme v4.9 , as you would see this theme version have no modifications and i understand is supposed to work as it is showing skus as this is a default wordpress behaviour , in this case the sku appears when deactivating the layout builder (but this is not a solution for us as this broke the site design). it seems a problem with the new theme layout builder on the product page when updating?
March 6, 2022 at 7:47 pm #1343371Hi,
Thank you for your patience, what I meant was that I believe that your v4.8.1 was modified to show the SKU without using the Product Meta Info element, and when you test one of the other versions they don’t have the same modifications. This is why I pointed out that your v4.8.1 has a lot of custom functions in the parent theme functions.php, as I investigate further I find that your v4.8.1 has two extra directoriesconfig-templatebuilder_original
andconfig-woocommerce2
leading me to believe that the original directories were modified.
I point this out because I created a clean install of v4.8.1 on a test server and couldn’t get the variable SKU to show without using the Product Meta Info element, I also tested v4.7.6 with no success without using the Product Meta Info element. So I thought that perhaps I didn’t create the variable product correctly so I exported your products and variables and the same product that we are testing on your site /metz-2/ doesn’t show the SKU or category on a clean install for me.
Did you have help creating this site, is it possible that it contains modifications?Best regards,
MikeMarch 8, 2022 at 4:41 pm #1343680Hi Mike, thanks for your help. I understand your point and in order to be sure, we will discard any possible change on the old 4.8.1 theme and we will use the 4.9 version, this version we know for sure that doesn’t have any change as it was installed few days ago. The issue then is the following:
– when we save the product with classic editor, it shows sku correctly in variable products
– when we save the product with Advanced layout builder (we need this), it doesn’t show the sku correclty in variable products. If you change the options for the product, it doesn’t update this variation sku (as it does when saved with classic editor)i already put the product meta info element in the product page.
the question is: what should we do in order to make it work showing sku in variable products when the product is saved with layout builder?
March 10, 2022 at 5:02 am #1343941Hi,
Thank you for the info.
We edited the product above, applied an SKU temporarily and the info is showing correctly in the product page. Please make sure to purge the cache after updating the SKU of the product. We provided a screenshot of the changes below. As you will see the SKU is updated beside the product category info.
Best regards,
IsmaelMarch 10, 2022 at 3:27 pm #1344018Hi, thanks for your efforts. It’s strange, but i don’t see any change. (tested in chrome incognito mode to avoid cache and firefox) it shows always SKU: N/A Categoría: Operativos (even when changing product variation).
March 14, 2022 at 3:59 am #1344334Hi,
We actually removed the SKU after posting the screenshot above. Did you try adding it again? We applied a temporary SKU to the product again. Please make sure to purge the cache.
Best regards,
IsmaelMarch 14, 2022 at 3:48 pm #1344420Hi Ismael, i see the sku:123456789 now, but the problem persists. as you could see, if you change the product variation on the select box, it does not show the variation sku, always shows 123456789.
you can check that this behavior is different when you disable layout builder, that is, in this other case, when you change the product variation on the select box, it shows the variation sku as expected. (in this case we need to use de layout builder)
March 15, 2022 at 4:36 am #1344479Hi,
Thank you for the clarification.
This is not working because the wp-content/plugins/woocommerce/assets/js/frontend/add-to-cart-variation.js file is not loaded when the builder is active. And since the product meta is a separate builder element of its own, the product meta container which contains the SKU is also outside the variations form. It should be inside the form for this to work properly. We will forward the issue to our channel for further investigation.
Best regards,
IsmaelMarch 16, 2022 at 10:42 am #1344711Hey!
Thank you for waiting.
To fix the issue with the product shortcode, please edit the enfold/config-templatebuilder/avia-shortcodes/product_snippets/product_snippet_button.php file, add update it using this code ( https://pastebin.com/cEDU5HQ4 ). Then edit the enfold/config-woocommerce/config.php file and update the avia_woocommerce_add_body_classes function around line 103 using this code.
function avia_woocommerce_add_body_classes( $classes, $class ) { global $product; if( avia_woocommerce_version_check( '3.0' ) ) { $classes[] = 'avia-woocommerce-30'; } /** * Adds the product class name to the body tag when ALB is activem, required by WC scripts such as add-to-cart-variation.js * * https://kriesi.at/support/topic/sku-on-product-page-disappeared-with-theme-update/ */ if( is_product() && Avia_Builder()->get_alb_builder_status( $product->get_id() ) == 'active' ) { $classes[] = 'product'; } return $classes; }
Please make sure to purge the cache after doing the steps above or before testing the page.
Best regards,
IsmaelMarch 16, 2022 at 3:03 pm #1344750Hi, we applied the file changes you mentioned, but it seems that the problem persists. Don’t show the variation products skus. Could you please check? tell me if you need ftp access to our site.
thanks
March 17, 2022 at 6:27 am #1344817Hi!
Did you modify the avia_woocommerce_add_body_classes function in enfold/config-woocommerce/config.php file? The class name “product” should be added to products using the ALB but we are not seeing it in the product page above. The add-to-cart-variation.js file is now loading correctly but it requires the product class name which will be added once you modify the avia_woocommerce_add_body_classes function in the config.php file as suggested above.
Thank you for your patience.
Regards,
IsmaelMarch 17, 2022 at 10:36 am #1344841hi, yes, we updated the enfold/config-woocommerce/config.php according your instructions
March 18, 2022 at 6:27 am #1345011Hi,
You accidentally removed this part from the config.php file. We added it back.
add_filter( 'body_class', 'avia_woocommerce_add_body_classes', 10, 2 );
Make sure to purge the cache before testing the product page.
Best regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.