Announcement

Collapse
No announcement yet.

Create Product with Shipping Dimensions

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

    Create Product with Shipping Dimensions

    Hi all,

    I am able to create products via a POST call such as:

    http://mysite.mivamerchant.net/creat...00&weight=2.00

    The page I am hitting has the following:

    <mvt:do name="l.success" file="g.Module_Library_DB" value="Product_Load_Code( g.code, l.settings:product )" />
    <mvt:if expr="ISNULL l.settings:product">
    <mvt:assign name="l.product:code" value="g.code" />
    <mvt:assign name="l.product:name" value="g.name" />
    <mvt:assign name="l.product:price" value="g.price" />
    <mvt:assign name="l.product:weight" value="g.weight" />
    <mvt:assign name="l.product:width" value="g.width" />
    <mvt:assign name="l.product:active" value="1" />
    <mvt:do file="g.Module_Library_DB" name="l.ok" value="Product_Insert( l.product )" />
    Product Added
    <mvt:else>
    Product Exists
    </mvt:if>

    The issue is that I need to add the Shipping Length, Width, and Depth to ensure that shipping calculates properly. Editing these items is a non-starter as I have millions of options.

    Is there a token for the Shipping Dimensions or how would I add the length, width and depth via my approach?

    #2
    Re: Create Product with Shipping Dimensions

    That's a somewhat risky way to create products. You might want to at least add some minimal security, such as a password, and maybe some validation for the input values. But to answer your question: the product dimensions are stored in a separate table: sNN_ProductShippingRules. I suppose there are library functions to manipulate this table, but they're not in the LSK. You can probably write your own DB queries using one of the Tool modules.

    HTH --
    Kent Multer
    Magic Metal Productions
    http://TheMagicM.com
    * Web developer/designer
    * E-commerce and Miva
    * Author, The Official Miva Web Scripting Book -- available on-line:
    http://www.amazon.com/exec/obidos/IS...icmetalproducA

    Comment


      #3
      Re: Create Product with Shipping Dimensions

      Thanks Kent. Great advice and I have it working via a server call.

      Originally posted by Kent Multer View Post
      That's a somewhat risky way to create products. You might want to at least add some minimal security, such as a password, and maybe some validation for the input values. But to answer your question: the product dimensions are stored in a separate table: sNN_ProductShippingRules. I suppose there are library functions to manipulate this table, but they're not in the LSK. You can probably write your own DB queries using one of the Tool modules.

      HTH --

      Comment

      Working...
      X