• When receiving a qoute request through yith the email displays Product/Quantity/Total, but when clicked on the link we cannot see product in shop unless logged into wp-admin and it redirects to product edit page.

    How can I change this code

            $product_admin_link = '';
            $posttype_object    = get_post_type_object( get_post( $_product->get_id() )->post_type );
            if ( ( $posttype_object ) && ( $posttype_object->_edit_link ) ) {
                $product_admin_link = admin_url( sprintf( $posttype_object->_edit_link . '&action=edit', $_product->get_id() ) );
            }
            ?>

    So that it will link to product page not admin/edit page?

    Thank you!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Alberto Martin

    (@albertomrtn)

    Hi @ramonamatins, unfortunately, what you need requires custom development.

    Hi,

    i need the same snippet, the email is used for response to client, with the PDF. The client have a link on product name to connect the admin…

    i need to change the admin link to product page link

    TY

    Same here, please give us the code for changing this. It’s not site depending i think.

    I also think, it’s better to make it default pointing to front-end. What’s the need of directing to wp-admin?

    Seanst3r

    (@seanst3r)

    I agree it is weird. Our sales people who get these quote requests don’t have permission to edit posts. It’s a fairly easy edit:

    /templates/emails/request-quote.php:

    $product_admin_link = $_product->get_permalink();

    I use the sku_shortlink plugin so this url is cooler:

    $product_admin_link = get_site_url() . ‘/products/’ . $_product->get_sku();

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.