BuyCred Checkout Transaction ID
-
Hi,
I am attempting to use MyCred in conjunction with another plugin, Classified Listing, and have placed a buyCred form using shortcode on the post that CL outputs, so that users can list their myCred points for sale and others can buy from the post. This works, no problem. However at present there is no link between the sale of the points and the listing post, so after the sale has been made, the post is still visible and somebody else can then also try to buy the points. Obviously the post could be edited/deleted manually, but I want to find a way for the post to automatically be changed, either so that it doesn’t display the buy form in the single listing after a sale, or the link from the list of listings redirects to a ‘Sorry this is sold’ page or similar.So I am wondering if you or someone in this support forum, could tell me how I could get the transaction_id that is generated at Checkout to be a reference to the CL post, so I can then have some code that would prevent anyone else trying to buy the same points, or some alternative way I could get to the same outcome? At the moment the transaction_id appears to be generated randomly with this code;
/** * Checkout: Transaction ID * @since 1.8 * @version 1.0 */ public function checkout_transaction_id() { $content = '<h2><span class="text-mutted">' . esc_js( esc_attr( __( 'Transaction ID', 'mycred' ) ) ) . '</span>' . esc_attr( $this->transaction_id ) . '</h2>'; return apply_filters( 'mycred_buycred_checkout_txtid', $content, $this ); }
This is in the file mycred-abstract-payment-gateway.php in the mycred/addons/buy-creds/abstracts folder. I think it should be possible to change that code to use either the post title or the post id but I don’t know if it will affect anything anywhere else.
Just in case anyone wants to suggest using WooCommerce, I am using Classified Listing because I am already using it on another part of my multisite setup and Woo is way too much plugin and way too difficult to adapt for what I want – I already tried.
Thanks in advance to anyone who might be able to help me with this.
- The topic ‘BuyCred Checkout Transaction ID’ is closed to new replies.