• Resolved hector0371

    (@hector0371)


    The project I am working on is about modifying payment method in woocommerce, so that every items posted can be exchanged for 1 token, instead of paying prices. I`ve been trying some reward points plugins, but they seems to be too complicated comparing to my needs. And I received some hints from other people, implying to me that there are much simple way to do so: after all, I dont need all those secure connections that would be required in real payments, and a localized payment method would do the trick. Can anyone tell me if there is a simple way like he said? My deepest thanks!

    Hector

Viewing 8 replies - 1 through 8 (of 8 total)
  • Hi Hector!

    A few questions come to my mind:

    If an item is one token of worth, how can you buy or obtain them? Do you get them by purchasing products or exchanging real money for them? Are these tokens already established (like cryptocurrencies), or are they custom-made by you?

    What is the workflow you expect to be?

    The more information we have, the better assistance we can provide.

    Let us know!

    Thread Starter hector0371

    (@hector0371)

    Thank you for your reply Juan!

    Yes, each time a new account is created, a few token is assigned to that account so that the user can trade them for items. The user can also display the items they want to give out in exchange for tokens. After that, I am expecting a global balance between [ getting items for token ] and [ getting token for items] among all users.

    It is similar to the relationship between human and trees: human take in oxygen and give out CO2, while trees take in CO2 and give out oxygen.

    I understand what you want to achieve.

    This is a quite specific customization; you would require plugins and/or custom code to accomplish it.

    Yes, each time a new account is created, a few token is assigned to that account so that the user can trade them for items.

    I think you could achieve this with the WooCommerce Points and Rewards extension.

    You can reward users with points for signing up and change points labels for ‘tokens’.

    Then, you can adjust the Redemption Conversion Rate to 1 token = 1 dollar: this way, users can buy items in your store with tokens.

    Check more about this here: https://woocommerce.com/document/woocommerce-points-and-rewards/#section-2

    Once you do this, you can change the dollar name and symbol from your store for the one you want, like Token (T) or else, with the code snippet found here:

    https://woocommerce.com/document/add-a-custom-currency-symbol

    You can use a plugin like Code Snippets to add this snippet without having to edit your php code.

    The user can also display the items they want to give out in exchange for tokens. After that, I am expecting a global balance between [ getting items for token ] and [ getting token for items] among all users.

    I couldn’t find any plugin or code available that does this part exactly.

    In this case, we recommend getting in touch with one of the customization experts listed on the WooCommerce Customizations Page; they can help you create the customization the way you need it.

    I hope this helps!

    Thread Starter hector0371

    (@hector0371)

    Thank you for your reply Juan!

    What you provided benefit to my progress a lot! Yes, I`m trying to modify some reward points plugins to do this,but i encountered some unexpected issues :

    1. Before tapping into reward plugins, the first thing I tried was to customize the “add product” page, leaving no space for pricing (as all products have to be assigned the same price as “1”). I got recommended to try the instructions posted here:

    <a href=”https://wordpress.stackexchange.com/questions/104760/woocommerce-how-to-set-product-regular-price-default&#8221; rel=”noopener” target=”_blank”></a>

    I tried the code listed there in <em>post.php</em> , and it worked in deleting the pricing column in “add new product – general” and make default price as “0” .However, I then realized that I have to make the default price as “1”, instead of “0” as used in the code above. So I change the code into this:

    function set_default_price( $post_id, $post ) {
    
        if ( isset( $_POST['_regular_price'] ) && trim( $_POST['_regular_price'] ) == '' ) {
            update_post_meta( $post_id, '_regular_price', '1' );
        }
    
    if ( isset( $_POST['_sale_price'] ) && trim( $_POST['_sale_price'] ) == '' ) {
            update_post_meta( $post_id, '_sale_price', '1' );
        }
    
    }
    add_action( 'woocommerce_process_product_meta', 'set_default_price' );

    Then nothing happened. All new products added still has no price.

    The next step I tried was to delete the filter/action I created using this

    add_action('init', 'remove_main_functions', 15 );
    
    function remove_main_functions() {
    
        remove_action( 'woocommerce_process_product_meta', 'set_default_price' );

    To my surprise, all of the “add new product- general” part is erased ,leaving only blank space there.I am curious about what happened there.

    2.I have been looking into the plugin you mentioned. It seems that this plugin do not provide a gateway for purchasing through points. I cannot find similar description in that plugin.Did I skipped some instructions? That function is crucial to my needs.

    3.As for this part:

    <blockquote>The user can also display the items they want to give out in exchange for tokens. After that, I am expecting a global balance between [ getting items for token ] and [ getting token for items] among all users.</blockquote>

    This is a blockage I`m facing. My current thoughts are to find an appropriate multi-vendor plugin, and to make the “reward point” function mentioned above to be used in such an environment. I do not have any clue about that at this time, as all “reward points” plugins I tried seem to be used in single-vendor environment. So if you have any idea in making a function to work in multi-vendor environment,please let me know.

    4.Thank you for mentioning getting support from woocommerce customization.I realized that what I`m trying to do is an advanced-level customization. Yet from my past experience, it is not easy to make a international transaction from my country here.So getting help from this forum is currently the best approach I could choose.

    I`m grateful for the help you provided. Thank you !

    • This reply was modified 2 years, 9 months ago by hector0371.
    • This reply was modified 2 years, 9 months ago by hector0371.
    • This reply was modified 2 years, 9 months ago by hector0371.

    Hi @hector0371

    Thanks for the update.

    As support for custom coding is beyond the scope of support we are able to provide in this forum, you may want to reach out to our customization experts as suggested above. This particular forum is for questions that are related to the WooCommerce core features.

    We can also recommend the following places for development-oriented questions:

    As for the WooCommerce Points and Rewards plugin, please feel free to ask any questions related to this plugin, by creating a ticket here. You’d need to log into your WooCommerce account before you can access that page, or create an account if you do not have one.

    Just so you know, in the WooCommerce.com marketplace we offer a 30-day refund policy so you can test the extension and make sure it works for you.

    I hope you find this information helpful.

    Thread Starter hector0371

    (@hector0371)

    I`m not expecting to find elixir here. All I want to know is how to override woocommerce paymentgateway with the local method I mentioned (1 item for “1 token”) so that I can get the right direction to keep going. It is true that I mentioned dokan and other third-party plugins, but that is not the core in my problem.

    Plugin Support Paulo P – a11n

    (@paulostp)

    Hello,

    All I want to know is how to override woocommerce paymentgateway with the local method I mentioned (1 item for “1 token”)

    That’s the part that will require custom coding. I’ve looked around and found no extension that could help you with that.

    I suggest you try the Facebook group and the Slack channel mentioned above. You might have better luck there.

    Still, we’ll keep this topic open for a while to allow other users from the community to share their ideas.

    Thread Starter hector0371

    (@hector0371)

    Thank you Paulo! I have been reading the documentations and pages you posted. They did resolve some problems, yet new problems just keep popping up. Honestly, I was hesitated when trying to post my questions here , since my questions were more “personal” than most core-modifications.

    Again, thanks for your help so far! I will keep studying docs on customizing woocommerce in search for new insights.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘How to override payment method with a token-based method’ is closed to new replies.