Home › Forums › WoodMart support forum › Instant Page feature
Instant Page feature
- This topic has 11 replies, 2 voices, and was last updated 4 years, 4 months ago by
Artem Temos.
-
AuthorPosts
-
March 10, 2021 at 6:32 am #272269
roadlinkParticipantHello,
Our compare and wishlist function was not working very well.
It was not showing lastly added product.
If we refresh the page, It was working.We have reached to plugin developer and he replied as below.
Can you suggest any solution?
We understand that it happens due to “instant page” feature, which we activated with perfmatters plugin. But some other plugins are also have similar function.
”
OK, we figured out what it was. It was caching in a sense, but caching due to Instant Page. So I disabled Instant Page so those will work on your live site. If you can please confirm as well.So we need to add a data attribute on your wishlist and compare links in the menu.
However, it’s a little trickier than that because it’s not a physical menu in WordPress. It’s added by your Woodmart theme.What I would do is reach out to your theme developer and ask them how to add a data attribute on those links. Basically we need to add data-no-instant on them. That will prevent Instant Page from running.
They need to essentially look like this:
<a href="https://www.xxx.com/favoriler/">content....</a> <a href="https://www.xxx.com/karsilastir/">content....</a>
Perhaps they have a code snippet they can provide to do that? I see you already have Code Snippets running, so that should be pretty easy to add if they can provide something.
Thanks!
Brian
“March 10, 2021 at 7:10 am #272280
Artem TemosKeymasterHello,
Could you please send us a screenshot of what links do you want to customize? We will give you a file location where the code for them is written.
Kind Regards
March 10, 2021 at 12:33 pm #272371
roadlinkParticipantHello Artem,
Thanks for quick reply.
I have added.March 10, 2021 at 12:38 pm #272378
Artem TemosKeymasterYou can customize them in files
woodmart/header-elements/wishlist.php woodmart/header-elements/compare.php
March 10, 2021 at 12:42 pm #272381
roadlinkParticipantcan i copy these file to child theme and edit in there?
Will it work?March 10, 2021 at 12:58 pm #272390
Artem TemosKeymasterYes, you can override them in the child theme.
March 10, 2021 at 7:43 pm #272518
roadlinkParticipantThank you, I have managed to change the header links.
But we needed to change single product links too.Any suggestion for that?
March 11, 2021 at 7:21 am #272613
Artem TemosKeymasterHello,
Sorry, but your support period is over a few months ago. Please, extend it if you need more help from us.
Kind Regards
March 11, 2021 at 9:07 pm #272833
roadlinkParticipantHi,
I just bought extension for support 🙂
Could you please help?
thanks.
March 12, 2021 at 7:19 am #272918
Artem TemosKeymasterHello,
You can find them in
woodmart/inc/integrations/woocommerce/modules/compare.php
file function name –function woodmart_add_to_compare_btn
and this onewoodmart/inc/integrations/woocommerce/modules/wishlist/class-ui.php
, function –public function add_to_wishlist_btn
.Kind Regards
March 12, 2021 at 8:44 am #272944
roadlinkParticipantActually I found these files yesterday and put these codes.
but it didn’t worked.
I put updated files to child theme with same folder paths.I don’t get why it works for header elements but not work for pages.
I cleared the cache both from server and cloudflare.* Add to compare button on loop product.
printf( '<a href="%s" class="%s" data-product_id="%d" rel="nofollow" data-no-instant>%s</a>', woodmart_compare_add_product_url( $product_id ), 'compare', $product_id, $button_text );
* Add to compare button on single product.
printf( '<a href="%s" class="%s" data-product_id="%d" rel="nofollow" data-no-instant>%s</a>', woodmart_compare_add_product_url( $product_id ), 'compare', $product_id, $button_text );
Wishlist
* Add to wishlist button.
<a href="<?php echo esc_url( woodmart_get_whishlist_page_url() ); ?>" data-key="<?php echo esc_attr( wp_create_nonce( 'woodmart-wishlist-add' ) ); ?>" data-product-id="<?php echo esc_attr( get_the_ID() ); ?>" data-added-text="<?php esc_html_e( 'Browse Wishlist', 'woodmart' ); ?>" data-no-instant><?php esc_html_e( 'Add to wishlist', 'woodmart' ); ?></a>
public function remove_btn() { ?> <div class="wd-button-remove-wrap"> <a href="#" class="woodmart-wishlist-remove wd-cross-button wd-with-text-left" data-key="<?php echo esc_attr( wp_create_nonce( 'woodmart-wishlist-remove' ) ); ?>" data-product-id="<?php echo esc_attr( get_the_ID() ); ?>" data-no-instant>
March 12, 2021 at 9:23 am #272949
Artem TemosKeymasterThese files can’t be overridden in the child theme, unfortunately. They are PHP classes and can be loaded from the parent theme only.
-
AuthorPosts
- You must be logged in to create new topics. Login / Register