Producr Redirect
-
/loop/add-to-cart.php
global $product;
if ( $product->product_type == “simple” ) {
$simpleURL = get_permalink();
$simpleLabel = “View Product”; // BUTTON LABEL HERE
} else {
$simpleURL = $product->add_to_cart_url();
$simpleLabel = $product->add_to_cart_text();
};echo apply_filters( ‘woocommerce_loop_add_to_cart_link’,
sprintf( ‘%s‘,
esc_url( $simpleURL ),
esc_attr( $product->id ),
esc_attr( $product->get_sku() ),
esc_attr( isset( $quantity ) ? $quantity : 1 ),
$product->is_purchasable() && $product->is_in_stock() ? ‘add_to_cart_button’ : ”,
esc_attr( $product->product_type ),
esc_html( $simpleLabel )
),
$product );I use this code to redirect the customer to the product page first before making the purchase, but it doesn’t work when your plugin is activated.
how can i fix this? any code i can edit?
- The topic ‘Producr Redirect’ is closed to new replies.