Home Forums General Ideas Dokan – Charge for featured (sticky) product placement

This topic contains 6 replies, has 2 voices, and was last updated by  RevolvedMedia 3 years, 12 months ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #39681

    RevolvedMedia
    Member
    Post count: 43

    We would like to be able to charge a fixed price to feature (sticky) a product for a set duration.

    The scenario:

    – Seller logins in to dashboard
    – Seller fills out the add new product form:
    Options:
    1)Add a check box [ ] Feature Product for $xx.xx
    When checking the box – the user is taken to checkout to pay for the feature placement
    2) Light box pop up “Would you like to feature your product” Yes/No
    Yes – Take them to checkout to pay for feature placement
    No – Close light box

    Upon payment confirmation product is made sticky and automatically set to approved from pending.

    – cron function to unstick expired featured (sticky) products

    Let me know if this is something in the works or if I should begin moding or creating an addon to do so.

    Thanks for any information,
    Rob

    #39684

    Nayem
    Moderator
    Post count: 6480

    Hello Robert,

    Thank you very much for your great idea. We do not have this feature right now. But we will work on featured product for seller. We did not start it yet.

    Thank you ๐Ÿ™‚

    #39939

    RevolvedMedia
    Member
    Post count: 43

    I'm going to be working on this as well, I hope you don't mind but I will document files changes here to help me keep track of what files I have modified and where. As well this might help you in implementing this feature faster.

    #39943

    RevolvedMedia
    Member
    Post count: 43

    Line numbers listed are placement within the modified file and will not reflect the location to insert the code in an original unmodified file.

    /dokan/templates/product-listing.php

    
    //Added the featured column label to the products dashboard list
    Line: 26 - <th><?php _e( 'Featured', 'dokan' ); ?></th> <?php /* RevolvedMedia - Modified - March 25 2015 */ ?>
    
    
    //Added product featured status column value and statement
    Line 80 -   <td class="featured column-featured"><?php  /* RevolvedMedia - Modified - March 25 2015 */
                    if($product->is_featured()){
    			echo '<span class="wc-featured tips">Yes</span>';
    		} else {
    		        echo '<span class="wc-featured not-featured tips">No</span>';
    		}
                    ?>
                 </td><?php /* End Modified code */ ?>
    

    //More to come….

    #39955

    Nayem
    Moderator
    Post count: 6480

    Hello,

    Sure, You are always welcome to share good things in our forum.

    Thank you ๐Ÿ™‚

    #39956

    RevolvedMedia
    Member
    Post count: 43

    Great thanks!

    #39973

    RevolvedMedia
    Member
    Post count: 43

    //Next we created a product category using the wp admin dashboard. The category will be used for site products only. This way we can utilize the build in cart and woocommerce payment system – and the woocommerce_order_status_completed to process our order ๐Ÿ˜‰

    /wp-admin/edit-tags.php?taxonomy=product_cat&post_type=product

    For example purposes:

    Our Products
    – Advertising

    We're using a sub category for our “Advertising” products as we may add additional products at a later date. Keeping our options open ๐Ÿ™‚

    We don't want all stores to have access to this Category so lets filter out for anyone but admin.

    Note, Dokan has two options for displaying categories selections: Single and Multiple. but we can handle both with a single variable.

    We will want to make this change in two files:

    /dokan/templates/new-product.php
    ===============================================

    Line: 62

    <?php
      /**************
       * RevolvedMedia - Modified - March 25 2015
       * 
       * Our Admin only categories are:
       * 
       * 107 - Our Products - You can find your values by inspecting the drop down
       * 108 - Advertising
       * 
       * These will be filtered out for all except admins - (ideally once is_admin is working)
       * 
       * You can find the values for your categories by checking the values in the drop down
       * 
       * @ to-do Add an option within Dokan Admin dashboard to select "admin only" categories
       * and pass the value globally with the plugin
       * 
       * Note: is_admin is not functional and always returns false
       *    - not sure if its Dokan or something else, will update code once I find the issue
       *    - until then it doesn't hurt to leave it in place
       */ 
                                                
         if(!is_admin()){ 
             $exclude_admin_category = "107,108";
         } else {
             $exclude_admin_category = "";
         }
      ?> 
    

    Line: 100 // Added exclude value – RevolvedMedia – Modified – March 25 2015

    'exclude' => $exclude_admin_category,

    Line: 120 // Added exclude value – RevolvedMedia – Modified – March 25 2015

    'exclude' => $exclude_admin_category,

    /dokan/templates/product-edit.php
    ===============================================

    Line: 241

    <?php
      /**************
       * RevolvedMedia - Modified - March 25 2015
       * 
       * Our Admin only categories are:
       * 
       * 107 - Our Products - You can find your values by inspecting the drop down
       * 108 - Advertising
       * 
       * These will be filtered out for all except admins - (ideally once is_admin is working)
       * 
       * You can find the values for your categories by checking the values in the drop down
       * 
       * @ to-do Add an option within Dokan Admin dashboard to select "admin only" categories
       * 
       * 
       * Note: is_admin is not functional 
       *    - not sure if its Dokan or something else, will update code once I find the issue
       */
                                                
         if(!is_admin()){ 
             $exclude_admin_category = "107,108";
         } else {
             $exclude_admin_category = "";
         }
      ?>    
    

    Line: 290 // Added exclude value – RevolvedMedia – Modified – March 25 2015

    'exclude' => $exclude_admin_category,

    Line: 315 // Added exclude value – RevolvedMedia – Modified – March 25 2015

    'exclude' => $exclude_admin_category,

    Now the categories are hidden when editing or posting a new product.

Viewing 7 posts - 1 through 7 (of 7 total)

The topic ‘Dokan – Charge for featured (sticky) product placement’ is closed to new replies.