Add Item In Cart

This topic contains 8 replies, has 3 voices, and was last updated by  sumit singh 5 years, 7 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • 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: 29970

    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: 29970

    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: 1971

    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: 1971
    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)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket