Please submit a private ticket if you need to share sensitive information, such as license details and admin credentials.

Okay
  Public Ticket #4528614
Cannot edit quantity in sidecart or checkout?
Open

Comments

  •  6
    Nicolas started the conversation

    How can i edit quantitits of the items in components:

    - in cart
    - on checkout page

    Here is a video for your referance; https://www.loom.com/share/f963315187644dfb95c2910cd961a1d8

  •  1,623
    Dustin replied

    Hi Nicolas,

    Our plugin does not allow you to change the quantity of component products directly on the Cart/Checkout page. If you enable the "Edit link" feature, an Edit button will appear on each composite product so you can return to the product details page and edit the component products.

    2521501411.png

    You can check it on our demo page here: https://demo.wpclever.net/wooco/product/composite-products-04/

    If you want an Edit button like that on Sidecart, please provide your website credentials (wp-admin link, username, and password), or create a development or staging site with identical configurations so I can implement it for you.

    Best regards,
    Dustin

  •  6
    Nicolas replied

    Hi Dustin

    Yes we would very much want that on the sidecart and checkout - > the edit button.

    I added the login credentials in the private ticket, one time pass link, you can use the same credentials :)

    Thanks alot and merry christmas

  •  1,623
    Dustin replied

    I've added this snippet for you: https://elmate.no/wp-admin/admin.php?page=edit-snippet&id=51

    Now, you can see the Edit button on composite products:

    9219966759.png

    -----

    Added snippet:

    add_action( 'wp_footer', function () {
        ?>
        <style>
            .fkcart-product-type-composite .fkcart-item-title-price > a {
                display: inline-block !important;
            }
    
            .fkcart-product-type-composite .fkcart-item-title-price .wooco-cart-item-edit {
                margin-left: 5px;
                font-size: 14px;
            }
    	
    		.fkcart-product-type-composite .fkcart-item-misc .fkcart-item-price {
    			display: none;
    		}
        </style>
        <?php
    } );
    
    add_action( 'fkcart_before_item_meta', function ( $fkcart_item ) {
        $cart_item = $fkcart_item['cart_item'] ?? [];
    
        if ( ! empty( $cart_item['wooco_ids'] ) ) {
            $edit_url = add_query_arg( [
                    'edit' => base64_encode( $cart_item['wooco_ids'] ),
                    'key'  => $cart_item['key'] ?? ''
            ], $cart_item['data']->get_permalink() );
            echo ' <a class="wooco-cart-item-edit" href="' . esc_url( $edit_url ) . '">Edit</a>';
        }
    } );

    Best regards,
    Dustin

  •  1
    Alan replied

    Can I get a version of this snippet for the WPC Fly Cart? Also I would love it if on the regular (shortcode) woocommerce cart I could move the edit button into the quantity column.

    Thanks!

  •  1,623
    Dustin replied

    Please add the custom code below. (How to add custom code? ↗):

    add_action( 'wp_footer', function () {
        ?>
        <style>
            .woofc-area .woofc-area-mid .woofc-item .woofc-item-inner .woofc-item-info .woofc-item-title, .woofc-area .woofc-area-mid .woofc-item .woofc-item-inner .woofc-item-info .woofc-item-edit {
                display: inline-block !important;
            }
        </style>
        <?php
    } );
    
    add_action( 'woofc_below_item_name', function ( $product, $cart_item ) {
        if ( ! empty( $cart_item['wooco_ids'] ) ) {
            $edit_url = add_query_arg( [
                    'edit' => base64_encode( $cart_item['wooco_ids'] ),
                    'key'  => $cart_item['key'] ?? ''
            ], $cart_item['data']->get_permalink() );
            echo ' <a class="woofc-item-edit wooco-cart-item-edit" href="' . esc_url( $edit_url ) . '">Edit</a>';
        }
    }, 99, 2 );

    3031876547.png

    OR this snippet:

    add_action( 'wp_footer', function () {
        ?>
        <style>
            .woofc-item-qty .woofc-item-edit {
                display: block !important;
                margin-bottom: 2px !important;
            }
        </style>
        <script>
            (function ($) {
                $(document).on('woofc_show_cart woofc_cart_loaded', function (e) {
                    if ($(document).find('.woofc-item-info .woofc-item-edit').length > 0) {
                        $(document).find('.woofc-item-info .woofc-item-edit').each(function () {
                            $(this).prependTo($(this).closest('.woofc-item-inner').find('.woofc-item-qty'));
                        });
                    }
                });
            })(jQuery);
        </script>
        <?php
    } );
    
    add_action( 'woofc_below_item_name', function ( $product, $cart_item ) {
        if ( ! empty( $cart_item['wooco_ids'] ) ) {
            $edit_url = add_query_arg( [
                    'edit' => base64_encode( $cart_item['wooco_ids'] ),
                    'key'  => $cart_item['key'] ?? ''
            ], $cart_item['data']->get_permalink() );
            echo ' <a class="woofc-item-edit wooco-cart-item-edit" href="' . esc_url( $edit_url ) . '">Edit</a>';
        }
    }, 99, 2 );

    1069793769.png

    Best regards,
    Dustin

  •  6
    Nicolas replied

    Thanks alot!