Home › Forums › WooCommerce Personalized Product Options Manager (PPOM) › Cart Edit Addon › Reply To: Cart Edit Addon
September 3, 2018 at 2:33 pm
#9297
Participant
You are missing the point here…… the LINK doest not contain the selected variation
I changed this already in your function: function edit_button( $cart_item_key, $cart_item ) {
I replaced:
$ppom_edit_url = add_query_arg($query_args, get_permalink($product_id));
with:
$_product = apply_filters( 'woocommerce_cart_item_product', $cart_item['data'], $cart_item, $cart_item_key );
$product_id = apply_filters( 'woocommerce_cart_item_product_id', $cart_item['product_id'], $cart_item, $cart_item_key );
$product_permalink = apply_filters( 'woocommerce_cart_item_permalink', $_product->is_visible() ? $_product->get_permalink( $cart_item ) : '', $cart_item, $cart_item_key );
//$ppom_edit_url = add_query_arg($query_args, get_permalink($product_id));
$ppom_edit_url = add_query_arg($query_args, $product_permalink);
Now the edit button has the full link including the variation. This works.
Now I do not want a BUTTON, but the product link to be like this… I will try and add it.