Announcement

Collapse
No announcement yet.

Discount on In stock Items ONLY?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Discount on In stock Items ONLY?

    I'd like to setup a Price Group Discount and offer a sale on items that are in stock only (many of our items allow pre-orders). Is there a way to run this sale?
    Basically, if the product is in stock, the sale price should show, once inventory hits 0 or into the negative, the sale should be removed and the regular price should show.
    We've have over 2000+ products that will be on sale so it's not something I can manage manually and I'd rather not have to temporarily prevent pre-orders and lose those pre-orders.
    Any ideas on how I can do this?

    #2
    crozon21 You could use the Collections feature that was added in Version 10.09.00

    https://docs.miva.com/miva10/referen...de/collections

    Although there is not a check on the inventory count you could use a custom field that defines the pre-sale products to exclude them from the collection.

    Then once the collection is created you can assign it to any price group just like a category.

    -Nick
    Nicholas Adkins
    Technical Training Specialist / Miva, Inc.
    [email protected]
    https://www.miva.com/mivalearn

    Comment


      #3
      That's exactly what we need as well for the same exact purpose. The Collections feature should really have inventory count as a filter option. As a workaround, we are just about ready to implement a scheduled task module that will set a custom field = inventory count (just tested it about 30 mins ago in our test store). That field will then be used by a collection's filter.
      Paul

      Comment


        #4
        Nick That may work as a way to quickly create the "category/collection".
        What happens if someone purchases a product where stock = 1 (so now stock = 0). I imagine it would still show as on sale to the next shopper even thought we don't have inventory?

        I may have a workaround. I could create a collection/category with any products that are in stock currently then put that collection/category on sale. As products are sold I can check for 0 stock and then remove them from that collection/category which takes them out of the sale. It's not perfect but it would at least get me started for this sale.

        Comment


          #5
          I helped someone use the Product Data Fields and Feeds module to create a product custom field that updates each time the product's inventory is updated in real time.

          Here is a link to more information about the Product Data Fields and Feeds module: https://docs.miva.com/miva10/referen...elds-and-feeds

          And here is a link to the snippet I created with notes about how to implement the functionality: https://snippets.cacher.io/snippet/076eeb68a5c5a425bd56
          Last edited by Nick; 11-26-24, 12:31 PM.
          Nicholas Adkins
          Technical Training Specialist / Miva, Inc.
          [email protected]
          https://www.miva.com/mivalearn

          Comment


            #6
            Nick - That is pretty cool. How does the custom field get set initially for all of the products?
            Paul

            Comment


              #7
              ocpxc02 You could import it manually or when setting up the scheduled task there is an option to add all active products (or all products). This option is typically used during the initial setup process then it should be adjusted to Queued Products once all the products are populated.
              Nicholas Adkins
              Technical Training Specialist / Miva, Inc.
              [email protected]
              https://www.miva.com/mivalearn

              Comment


                #8
                Nick - Thanks!
                Paul

                Comment


                  #9
                  Nick - Does the template code need to be modified if we don't use variants? And, does the module create the custom product field or does this need to be manually created? I believe I followed instructions properly. The task is properly triggered when I change a product's inventory count and is running. But, I don't see the custom field "Variant Inventory Count".
                  Paul

                  Comment


                    #10
                    ocpxc02 The template code has a default condition if the product does not have variants (lines 63-65)

                    And the module will actually create three custom fields, one with whatever value is rendered in the template (that will be the name you give the field), one with the last time the value was updated, and finally one that says if it is in the queue.

                    These custom fields are only visible in the Catalog Batch list by selecting the plus sign then choosing to display the custom field columns.

                    If you are still having issues with the implementation you can DM me with the URL and I will take a look.
                    Nicholas Adkins
                    Technical Training Specialist / Miva, Inc.
                    [email protected]
                    https://www.miva.com/mivalearn

                    Comment


                      #11
                      OK, I found the fields, but don't see anything > 0. When there are no variants, it looks like its outputting l.settings:master_product:total_inv, which is set to 0 at line 43 and only updated if there are any variants to loop through. I'll message you shortly.
                      Paul

                      Comment


                        #12
                        Nick We got this to (mostly) work on our end. Just need help with one part.
                        1. Created a Collection with the criteria of what I needed on sale
                        2. Created a price group with the discount and assigned the collection to this price group
                        3. Created the Product Data Feed that updates a custom field to either "In stock" or "out of stock" depending on inventory count. (we used a custom field so it could be a facet also, just fyi).

                        So far the Data Feed and Collection are working as expected. As long as the product custom field lists "in stock" (which was a collection criteria), it puts that item in the collection and price group then puts the item on sale. I manually loaded the products to start via import/export.

                        The issue I've run into is that while the collection seems to update regularly, the price group can't seem to keep up. I have products that match the criteria and are in the collection but when I check the price group they don't seem to be added to the sale price group. Is there a second scheduled task that needs to run to add and remove products from the price group as the collection is updated? Right now I have to manually update the price group to get it to keep working.

                        When I check the price group and click on Discounted Collections it shows there are over 3076 products in the specific collection that's assigned. However, when I click on Discounted Products for that sale, it's only showing 2692 products. So it seem like the price group doesn't seem to be updating as we're adding new inventory to the site and items are being purchased. Thoughts?

                        Comment


                          #13
                          crozon21 Can you DM the store you are working on and I can take a look. There should not be any additional steps from the process you described so there may be another factor causing the issue. If you can send me the store information I will log in and take a look at the setup and see if I can narrow done the issue.
                          Nicholas Adkins
                          Technical Training Specialist / Miva, Inc.
                          [email protected]
                          https://www.miva.com/mivalearn

                          Comment


                            #14
                            Nick I sent you an email!

                            Comment

                            Working...
                            X