WCMp bundle is available at a slashed price

Grab It Now

Cart Quantity

Cart Quantity2018-12-06T10:55:40+00:00

Home Support Forum WCMp Catalog Enquiry Cart Quantity

WCMp Catalog Enquiry

Cart Quantity Open

Tagged: , ,

  • Author
    Posts
  • joe1
    Participant
    Post count: 2

    Hello,

    I have the pro version.

    I need to print or echo the number of items in the Enquiry cart on my pages or menu. Something like “You have ‘x’ items in your enquiry cart right now.”

    I’ve tried
    echo sprintf ( _n( ‘%d item’, ‘%d items’, WC()->cart->get_cart_contents_count() ), WC()->cart->get_cart_contents_count() );
    but it just says 0 items.

    Also, the mini cart that floats at the bottom right corner of mobile browsers is consistently 0, and does not change if I add in more items to the enquiry cart. Is this feature broken currently?

    Please advise on the PHP code to display the enquiry cart quantity as a number.

    Thank you,

    Joe

  • CrazyPluginAuthor Khokan
    Keymaster
    Post count: 92

    @joe1, thanks for the query.

    In order to get number of cart items, just remove WC()->cart->get_cart_contents_count() and add this count($WCMP_Woocommerce_Catalog_Enquiry_Cart->get_enquiry_data()). But remember, add global $WCMP_Woocommerce_Catalog_Enquiry_Cart; before your code.

    Let us know if you have any further query.

  • joe1
    Participant
    Post count: 2

    Hello,

    How would I add the global $WCMP_Woocommerce_Catalog_Enquiry_Cart; before my code?

  • CrazyPluginAuthor Khokan
    Keymaster
    Post count: 92

    @joe1, Define this global $WCMP_Woocommerce_Catalog_Enquiry_Cart;, before your echo code.

Please LOGIN to reply to this topic