• Resolved AWOL

    (@awol)


    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.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi @awol,

    Thank you for contacting us, We have forwarded the details to the QA Team we will get back to you once we hear back from them.

    Hi @awol,

    Currently, we don’t have any official integration with the classified listening also. You cannot find post by transaction id. The functionality you’re trying to achieve ain’t possible with it, and The transaction ID is not generated from the form. The transaction ID is generated randomly.

    Thread Starter AWOL

    (@awol)

    Hi, and thank you for the reply. Yes, I was aware that the transaction ID is randomly generated, and I wasn’t planning on trying to use it in the way you said, trying to find the post. What I was hoping to get from you was that if the code I attached in my opening post was altered somehow so that the transaction ID was instead something that included the post ID, that this would not cause any problems or have any impact elsewhere in the plugin, and that I would then be able to rig something up which would automatically change the CL post so that someone else would not try or be able to buy the same points again. I want to be able to tie the CL post and the purchase of points together, and have the post automatically become unavailable once the points are sold, and not have to manually change things every time.
    I can’t imagine there is anything other than the myCred log that references the random transaction ID number, so I think I should be fine to go ahead and make alterations, but I just wanted to check before doing so.

    Hi @awol,

    Yes, you can use that apply filter for your custom work. It won’t affect anywhere in myCred

    Thread Starter AWOL

    (@awol)

    OK thank you for confirming.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘BuyCred Checkout Transaction ID’ is closed to new replies.