Home Forums WoodMart support forum Custom PHP code

Custom PHP code

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #688144

    rmigadde
    Participant

    Hello am trying to hide, add to cart for a particular product but it seems am not geting it right, here is my snippet, please guide:

    // For shop/archive pages
    add_filter( ‘woocommerce_loop_add_to_cart_link’, ‘hide_add_to_cart_link’, 10, 2 );
    function hide_add_to_cart_link( $link, $product ) {
    if ( 2532 == $product->get_id() ) {
    return ”;
    }
    return $link;
    }

    // For single product pages
    add_action( ‘woocommerce_single_product_summary’, ‘hide_single_add_to_cart’, 1 );
    function hide_single_add_to_cart() {
    global $product;
    if ( 2532 == $product->get_id() ) {
    remove_action( ‘woocommerce_single_product_summary’, ‘woocommerce_template_single_add_to_cart’, 30 );
    }
    }

    #688263

    Artem Temos
    Keymaster

    Hello

    Thank you for sharing your code snippet. Unfortunately, we are unable to provide support for custom PHP code modifications as it is beyond the scope of our theme support. We recommend consulting a developer to assist you with this customization.

    Regards

    #694235

    rmigadde
    Participant

    Hello, the same issue happened again, there are no log files created or specify where to find these logs, the Home page was deleted automtically. this really frustrating all the work we had put in, the website is supposed to be published this Friday.
    Please look into this an give me a report.

    Attachments:
    You must be logged in to view attached files.
    #694259

    Artem Temos
    Keymaster

    Hello,

    Please update the theme to the latest version. We have already fixed this issue.

    Kind Regards

    #694328

    rmigadde
    Participant

    This means you knew the issue but you denied this at first, how funny.

    #694354

    Artem Temos
    Keymaster

    No, we didn’t deny the issue and attempt to reproduce it on your website. However, we were able to reproduce it on another customer’s website, which helped us identify and fix the problem.

    Kind Regards

Tagged: 

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

The topic ‘Custom PHP code’ is closed to new replies.