Update package add to cart
This topic contains 9 replies, has 4 voices, and was last updated by Patrik 5 years, 12 months ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket-
AuthorPosts
-
April 17, 2019 at 7:01 am #481263
Hi there,
I have two packages free and premium. User can join to free package and update to premium later. I dont want the user to show the whole listing form when they update to premium.
I use invoicing plugin to handle the cart and invoice.
So, is there a function where I can pass the listingid(postid) and add the listing to cart and proceed to payment section?
It would be great if you could just provide me the function which will add the details to the invoicing and proceed to checkout.
Please let me know if you have any questions.
Thank you,April 17, 2019 at 11:42 am #481327That should happen automatically.
When you configure packages, and save, the packages are synced to WP Invoicing items.
When the user selects a package, they will be taken to checkout for the package automatically.April 18, 2019 at 1:25 am #481505Hey Alex,
Thank you for the reply. I am using my own custom page where I just show the package selection options only and not the whole listing form. I am trying to redirect the user to the cart/checkout page once the user selects the premium package. Is there a function where I can pass the post details and create invoice and redirect to checkout?April 18, 2019 at 11:50 am #481542I will flag your question for the developers, but, please say more:
Are you using WP Invoicing?
Can you post the code you have so far?April 19, 2019 at 10:33 am #481743The easiest way to do it might be to add something to the link like &auto_checkout=1 and then with some JS make the form auto submit, this would be the safest way as there is lots of error checking going on and its all submitted via ajax.
Stiofan
April 22, 2019 at 10:48 pm #482187Hey guys thank you for your response. I am using WP Invoicing plugin for the payment processing. The code I am using is somewhat like this: (package id: 5 is the premium package)
<?php if(isset($_POST['submit'])){ if($_POST['package'] == "5"){ $post = get_post($_POST['listingid']); //proceed to wp invoicing adding to cart and forward to the payment gateway } } //global $wpdb; //$sql = $wpdb->get_results("Update {$wpdb->prefix}geodir_gd_coach_detail set package_id=5 WHERE "); ?> <form method="post" action="" name="updatePackage"> Please select a package <br> <br> <input type="radio" name="package" value="1" checked> Free <input type="radio" name="package" value="5"> Premium <input type="hidden" name="listingid" value="<?php print $listingid?>"> <br> <br> <br> <input type="submit" name="submit"> </form>
April 23, 2019 at 10:37 pm #482410Hey guys any update on this?
April 24, 2019 at 5:53 am #482463Hey guys,
I found 2 functions in class-geodir-pricing-cart-invoicing.php file:
1. ajax_post_saved
2. create_invoiceNot sure which function to use.
I just want to redirect to the /wpi-checkout with the listing being added to cart and invoice. I would really appreciate your help on this. Please let me know if you have any questions.April 24, 2019 at 8:13 pm #482668Thanks for your post.
We don’t actually provide customizations here in the forum, though we do try to advise when we can and time allowing.
If you need time sensitive help for your customization from GD Experts you should contact a developer here.
https://geodirectoryexperts.com/
The developers will provide an update reply as soon as they are able.
April 26, 2019 at 5:38 am #482994Hi,
Can you look into this shortcode if it helps you to resolve your problem? https://wpinvoicing.com/docs/core-shortcodes/#wpinv_buy
You need to pass the item ID from WPI and not the package ID from GD. Let me know if you have any queries.
Regards,
Patrik -
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket