Home Forums WoodMart support forum Instant Page feature

Instant Page feature

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #272269

    roadlink
    Participant

    Hello,

    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.

    https://prnt.sc/10hrhzt

    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

    #272280

    Artem Temos
    Keymaster

    Hello,

    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

    #272371

    roadlink
    Participant

    Hello Artem,

    Thanks for quick reply.
    I have added.

    #272378

    Artem Temos
    Keymaster

    You can customize them in files

    woodmart/header-elements/wishlist.php
    woodmart/header-elements/compare.php
    #272381

    roadlink
    Participant

    can i copy these file to child theme and edit in there?
    Will it work?

    #272390

    Artem Temos
    Keymaster

    Yes, you can override them in the child theme.

    #272518

    roadlink
    Participant

    Thank you, I have managed to change the header links.
    But we needed to change single product links too.

    https://prnt.sc/10i8iy0

    Any suggestion for that?

    #272613

    Artem Temos
    Keymaster

    Hello,

    Sorry, but your support period is over a few months ago. Please, extend it if you need more help from us.

    Kind Regards

    #272833

    roadlink
    Participant

    Hi,

    I just bought extension for support 🙂

    Could you please help?

    thanks.

    #272918

    Artem Temos
    Keymaster

    Hello,

    You can find them in woodmart/inc/integrations/woocommerce/modules/compare.php file function name – function woodmart_add_to_compare_btn
    and this one woodmart/inc/integrations/woocommerce/modules/wishlist/class-ui.php, function – public function add_to_wishlist_btn.

    Kind Regards

    #272944

    roadlink
    Participant

    Actually 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>
    #272949

    Artem Temos
    Keymaster

    These files can’t be overridden in the child theme, unfortunately. They are PHP classes and can be loaded from the parent theme only.

Viewing 12 posts - 1 through 12 (of 12 total)