Home › Forums › WoodMart support forum › Some product pages are broken!
Some product pages are broken!
- This topic has 12 replies, 3 voices, and was last updated 1 year, 1 month ago by
Hung Pham.
-
AuthorPosts
-
January 11, 2024 at 12:12 pm #528990
ecom.france35ParticipantHello,
Our developer imports products from our suppliers via their API and when importing these products the pages are broken.
Here is the URL of an imported product: https://tapisbazar.com/products/tapis-enzo-carbone
Here is the URL of a NOT imported product: https://tapisbazar.com/products/assise-coussin-beige-o35-cm
The products all use the same Elementor template.
I disabled all non-essential plugins and it still doesn’t work so it’s not a plugin conflict.
After changing theme it works so it is a problem with Woodmart.
To be as efficient as possible, I left all non-essential plugins disabled + you have administrator access.
Thanks in advance for your help!
January 11, 2024 at 1:30 pm #529015
Aizaz Imtiaz AwanKeymasterHello,
Kindly switch to the parent theme on your website and check the problem.
Best Regards.
January 11, 2024 at 1:35 pm #529016
ecom.france35ParticipantIn fact, it works with parent theme.
But in any case, I need child theme.
How can we resolve it?
January 11, 2024 at 1:49 pm #529026
ecom.france35ParticipantI have just identified the source of the problem.
The child theme works when I remove this code from function.php:
// H4 ATC sticky title in p
// if ( ! function_exists( ‘woodmart_sticky_single_add_to_cart’ ) ) {
function woodmart_sticky_single_add_to_cart() {
global $product;if ( ! woodmart_woocommerce_installed() || ! is_product() || ! woodmart_get_opt( ‘single_sticky_add_to_cart’ ) ) {
return;
}woodmart_enqueue_js_script( ‘sticky-add-to-cart’ );
woodmart_enqueue_inline_style( ‘sticky-add-to-cart’ );if (woodmart_get_opt(‘mobile_single_sticky_add_to_cart’)) {
woodmart_enqueue_inline_style( ‘woo-mod-quantity-overlap’ );
}?>
<div class=”wd-sticky-btn<?php echo woodmart_get_old_classes(‘ woodmart-sticky-btn’); ?>”>
<div class=”wd-sticky-btn-container container<?php echo woodmart_get_old_classes(‘ woodmart-sticky-btn-container’ ); ?>”>
<div class=”wd-sticky-btn-content<?php echo woodmart_get_old_classes(‘ woodmart-sticky-btn-content’); ?>”>
<div class=”wd-sticky-btn-thumbnail<?php echo woodmart_get_old_classes(‘ woodmart-sticky-btn-thumbnail’ ); ?>”>
<?php echo woocommerce_get_product_thumbnail(); ?>
</div>
<div class=”wd-sticky-btn-info<?php echo woodmart_get_old_classes(‘ woodmart-sticky-btn-info’); ?>”>
<p class=”wd-entities-title”><?php the_title(); ?></p>
<?php echo wc_get_rating_html( $product->get_average_rating() ); ?>
</div>
</div>
<div class=”wd-sticky-btn-cart<?php echo woodmart_get_old_classes(‘ woodmart-sticky-btn-cart’); ?>”>
<span class=”price”><?php echo wp_kses_post( $product->get_price_html() ); ?></span>
<?php if ( $product->is_type( ‘simple’ ) ): ?>
<?php woocommerce_simple_add_to_cart(); ?>
<?php else: ?>
add_to_cart_url()); ?>” class=”wd-sticky-add-to-cart button alt<?php echo woodmart_get_old_classes( ‘ woodmart-sticky-add- to-cart’ ); ?>”>
<?php echo true == $product->is_type( ‘variable’ ) ? esc_html__( ‘Select options’, ‘woodmart’ ): $product->single_add_to_cart_text(); ?>
<?php Quick_Buy::get_instance()->output_quick_buy_button(); ?>
<?php endif; ?><?php do_action( ‘woodmart_sticky_atc_actions’ ); ?>
</div></div>
</div>
<?php
}
add_action( ‘woodmart_before_wp_footer’, ‘woodmart_sticky_single_add_to_cart’, 999 );This is a php code that Woodmart support previously gave me to replace the product title on the ATC sticky from H4 to p.
Please correct the code to resolve the bug.
January 11, 2024 at 7:34 pm #529124
Hung PhamKeymasterHi ecom.france35,
Thanks for reaching to us.
Please provide FTP info (server, username, password, port) to Private Content area.
I will check this problem for you.
Regards,
January 11, 2024 at 7:43 pm #529125
ecom.france35ParticipantPlease, check private content area
January 12, 2024 at 9:07 am #529182
Hung PhamKeymasterHi ecom.france35,
Thanks for details.
I re-enabled above function and Imported product still loading well https://tapisbazar.com/tapis-de-bain-noir Please note that function used to replace
h4
tag top
only.I also that you added many custom functions and errors in Console log https://prnt.sc/jar6ZDsoMef4. Please comment out other functions, deactivate all plugins (except Required Plugins) and then reactivate them one by one. This makes it very easy to isolate the plugins / functions causing problems.
Regards,
January 12, 2024 at 1:39 pm #529309
ecom.france35ParticipantHello,
The product charges well but the sticky add to cart has disappeared…
January 12, 2024 at 6:57 pm #529426
Hung PhamKeymasterHi ecom.france35,
I saw an errors in Console log on your site https://prnt.sc/Ljl7Wm582zYY
You should switch to Parent theme, deactivate all plugins (except Required Plugins) and then reactivate them one by one. This makes it very easy to isolate the plugin causing problems.
Regards,
January 12, 2024 at 7:24 pm #529436
ecom.france35ParticipantIt’s not a problem of conflict plugins because when I switch to parent theme, sticky add to cart appear correctly.
After, I checked and remove this code that your team gave me to modify sticky ATC title from H4 to p and issue is resolved :
// H4 titre sticky ATC en p
if ( ! function_exists( ‘woodmart_sticky_single_add_to_cart’ ) ) {
function woodmart_sticky_single_add_to_cart() {
global $product;if ( ! woodmart_woocommerce_installed() || ! is_product() || ! woodmart_get_opt( ‘single_sticky_add_to_cart’ ) ) {
return;
}woodmart_enqueue_js_script( ‘sticky-add-to-cart’ );
woodmart_enqueue_inline_style( ‘sticky-add-to-cart’ );if ( woodmart_get_opt( ‘mobile_single_sticky_add_to_cart’ ) ) {
woodmart_enqueue_inline_style( ‘woo-mod-quantity-overlap’ );
}?>
<div class=”wd-sticky-btn<?php echo woodmart_get_old_classes( ‘ woodmart-sticky-btn’ ); ?>”>
<div class=”wd-sticky-btn-container container<?php echo woodmart_get_old_classes( ‘ woodmart-sticky-btn-container’ ); ?>”>
<div class=”wd-sticky-btn-content<?php echo woodmart_get_old_classes( ‘ woodmart-sticky-btn-content’ ); ?>”>
<div class=”wd-sticky-btn-thumbnail<?php echo woodmart_get_old_classes( ‘ woodmart-sticky-btn-thumbnail’ ); ?>”>
<?php echo woocommerce_get_product_thumbnail(); ?>
</div>
<div class=”wd-sticky-btn-info<?php echo woodmart_get_old_classes( ‘ woodmart-sticky-btn-info’ ); ?>”>
<p class=”wd-entities-title”><?php the_title(); ?></p>
<?php echo wc_get_rating_html( $product->get_average_rating() ); ?>
</div>
</div>
<div class=”wd-sticky-btn-cart<?php echo woodmart_get_old_classes( ‘ woodmart-sticky-btn-cart’ ); ?>”>
<span class=”price”><?php echo wp_kses_post( $product->get_price_html() ); ?></span>
<?php if ( $product->is_type( ‘simple’ ) ) : ?>
<?php woocommerce_simple_add_to_cart(); ?>
<?php else : ?>
add_to_cart_url() ); ?>” class=”wd-sticky-add-to-cart button alt<?php echo woodmart_get_old_classes( ‘ woodmart-sticky-add-to-cart’ ); ?>”>
<?php echo true == $product->is_type( ‘variable’ ) ? esc_html__( ‘Select options’, ‘woodmart’ ) : $product->single_add_to_cart_text(); ?>
<?php Quick_Buy::get_instance()->output_quick_buy_button(); ?>
<?php endif; ?><?php do_action( ‘woodmart_sticky_atc_actions’ ); ?>
</div></div>
</div>
<?php
}
}SO please, give me a solution without bugs to modify the title of sticky ATC from H4 to p.
January 14, 2024 at 5:56 pm #529680
Hung PhamKeymasterHi ecom.france35,
I appreciate your patience.
I tested again on my end with provided code, everything worked well.
Would you mind if I remove Custom Code in functions.php in Child theme for further debug? I kindly recommend that you take a complete backup of your site before proceeding.
Regards,
January 14, 2024 at 9:59 pm #529703
ecom.france35ParticipantHi,
I already remove Custom Code in functions.php in Child theme so no issue appear.
BUT if I or you put the Custom Code in functions.php in Child theme, issue will appear so this code need to be changed.
Please, I only need to change sticky ATC title tag from H4 to p.
Thanks
January 15, 2024 at 3:06 pm #529936
Hung PhamKeymasterHi ecom.france35,
I’ve fixed your issue. Please check your site again.
Regards,
-
AuthorPosts
- You must be logged in to create new topics. Login / Register