Add Item In Cart

This topic contains 8 replies, has 3 voices, and was last updated by  sumit singh 3 weeks, 5 days ago.

  • Author
    Posts
  • #2924

    sumit singh
    Free User
    Post count: 12

    Hi Support,

    I am using Geodirectory with wp-invoicing plugin.Can you please tell me how can i add a package in the cart through hook if you provide or code.

    Thanks
    Sumit

    #2925

    Guust
    Moderator
    Post count: 26154

    You can create simple “Add to Cart/Buy Now” buttons.
    https://wpinvoicing.com/docs/core-shortcodes/

    Thanks

    #2926

    sumit singh
    Free User
    Post count: 12

    Hi Guust,

    Thanks for your reply.Actually i can’t use buttons because i want to do something else that is why i need any hook or any code you can provide.

    Thanks

    #2927

    Guust
    Moderator
    Post count: 26154

    GD packages can only be added to the cart by submitting a listing.
    I had missed that part of the question first.

    #2928

    sumit singh
    Free User
    Post count: 12

    Ok thanks for your help.

    Thanks

    #2929

    patrik
    Moderator
    Post count: 999

    Hi,

    You will need to get item ID from package ID you want to add and then insert that item to the invoice “cart_details” array or using

    $invoice->add_item($itemID, $args);

    function on the save_post hook if you want to add package while creating invoice from the backend.

    Regards,
    Patrik

    #2932

    sumit singh
    Free User
    Post count: 12

    Hello Patrick,

    Thanks for your reply i have used the above code but it’s not working i have added it in function file inside init hook.Let me give you some background what i want to do.ON click of button i am setting a cookie value on the basis of the cookie value i want a to add a package in the cart and redirect user to checkout page.Please give me any some guidance how can i achieve this.

    Thanks

    #2933

    patrik
    Moderator
    Post count: 999
    This reply has been marked as private.
    #2934

    sumit singh
    Free User
    Post count: 12

    Hi Patrick,

    Ok thanks for your help.

Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.