Announcement

Collapse
No announcement yet.

Why does changing permitted shipping methods update the store key?

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

    Why does changing permitted shipping methods update the store key?

    Just wondering - I noticed today that if I check, or uncheck, a shipping method under an item's Product > Shipping Rules section, the following store keys are incremented:

    ProductDisplayOrder
    Products

    A row is also added (or removed) from the s01_ProductShippingMethods, but it doesn't reference the display order anywhere. Is there some other important DB task that also takes place when the Shipping Rules are changed?

    The reason I ask is because I'd like to write a PHP script that will automatically add entries to the s01_ProductShippingMethods table for me. For example if I know all items in a certain category will always be permitted to use a certain shipping method that is otherwise not allowed, I'll grab all those item ID's and add a row to the s01_ProductShippingMethods table for them.

    disclaimer: I know it's frowned upon to directly mess with the DB like this, but it just makes life so much easier. If there's a way to accomplish my goal while using Miva's built-in routines I'd do that instead. I suppose I can use PHP to:

    A) log in to Miva as an Admin
    B) trigger a cURL POST that simulates a user enabling the particular shipping method under a product's admin screen, and clicking update.
    --- but, looking at the POST data that's sent when the user clicks that update button, I'm in no mood to replicate that.. Unless the system will allow me to only send the bare minimum (product ID, and the shipping method change info (four elements - module:code, code, name, permitted)).. I'll tinker with that on a test item..
    Looking for work as of March 2024! I've been a web developer for going on 20 years, with most of that time spent on Miva sites.

    #2
    Mike521w,

    I had development look at this and we were not able to replicate the change in store keys when selecting or deselecting a shipping method. Are you adding a product or are you working with an existing product?

    Wayne
    Wayne Smith

    Comment


      #3
      Wow that's really weird. I'm working with an existing product.. I made a series of pictures here so you can see exactly what I mean.
      Looking for work as of March 2024! I've been a web developer for going on 20 years, with most of that time spent on Miva sites.

      Comment


        #4
        Not sure what is changing that value but I assume a third party module. I just ran this test on my test store and get the same results as development did. The maxvalue for Products and ProductDisplayOrder did not change after adding or removing a Permitted Shipping Method at the product level. You might be able to track which module by running this test after deactivating each third party module one by one. I would suggest doing this on a development environment and do you have a development environment to run this test?

        Wayne Smith

        Comment


          #5
          No, we used to a while back but it's way outdated now (if it even still exists). I suppose I can open a ticket and ask for a new dev domain?
          Looking for work as of March 2024! I've been a web developer for going on 20 years, with most of that time spent on Miva sites.

          Comment


            #6
            I figured it out, you're right, it was a third party module called "Product Copy". It would increment those store keys every time I clicked the Update button (regardless of whether I made any changes or not). I'm not sure why it was doing that. Being that we rarely use the module, I removed it from the store for the time being.
            Looking for work as of March 2024! I've been a web developer for going on 20 years, with most of that time spent on Miva sites.

            Comment

            Working...
            X