Announcement

Collapse
No announcement yet.

Does anyone know what the 'Alternative Weight' Variable is called?

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

    Does anyone know what the 'Alternative Weight' Variable is called?

    So, with the EU-invoice report I have to set my shipping weight to be my actual product weight rather than a proxy to put the product into the right shipping Class which I've been doing up to now.

    Not a problem. I can transfer the proxy weights into the Alternative Shipping weight and use that for the shipping tables, which I've done.

    But I also use some PHP to show the delivery charges on the website product pages and I can't for the life of me find the variable for the Alternative Weight.

    Does anyone know?
    -----------------------------------------

    First Tackle - Fly Fishing and Game Angling

    -----------------------------------------

    #2
    Product Table - sAltWeight

    Comment


      #3
      Yup, thanks Mike, I can find it in the database and I’ve already populated it.

      What I can’t find is the Variable that can be used to reference it in php.

      For example the shipping weight Variable is “ShippingWeight” although in the database it’s held in the OpaqueShippingData column (or something similar, I’m not at my computer at the moment).
      -----------------------------------------

      First Tackle - Fly Fishing and Game Angling

      -----------------------------------------

      Comment


        #4
        It looks like SellerDeck haven't associated that setting with a variable name. You can use a lump of PHP to extract the value from the database.
        Code:
        <actinic:block php="true" >
        	// Get sAltWeight
        	$connect = odbc_pconnect("ActinicCatalog<actinic:variable name="ECMajorVersion" selectable="false" />","","", SQL_CUR_USE_ODBC); 
        	$query = "SELECT sAltWeight FROM Product WHERE [Product Reference]='<actinic:variable name="ProductID" encoding="perl" selectable="false" />'";
        
        	$result = odbc_exec($connect, $query);
        	if ( $result !== FALSE ) 
        		{
        		odbc_fetch_row($result);
        		echo odbc_result($result, 1);
        		}
        	odbc_close_all();
        </actinic:block>
        The above needs to be used in a layout where the product ID is in scope. It won't work in a BlockIf so if you need conditional code add it to the PHP above.
        Norman - www.drillpine.biz
        Edinburgh, U K / Bitez, Turkey

        Comment


          #5
          Thanks Norman,

          I was wondering if this is the case and I’d have to run the database query.

          I might just create another product variable and mirror the alternative weight value into that. It’s a waste of space and runs into the possibility of them getting out of sync but I somehow feel happier with the simpler code in sellerdeck.

          Mike

          -----------------------------------------

          First Tackle - Fly Fishing and Game Angling

          -----------------------------------------

          Comment


            #6
            An update and big thanks to Norman. The code he's given me above works perfectly and is now being used live on the site.

            I'm using it in the 'Standard Tax Inclusive Price' layout which is buried inside blockifs and the php block itself is contained inside a blockif that tests if Price is enabled and Product price raw !=0 without any problems.

            Thanks again.

            Mike
            -----------------------------------------

            First Tackle - Fly Fishing and Game Angling

            -----------------------------------------

            Comment


              #7
              That's good to hear. Regarding blockifs: I was trying to say that you couldn't put that lump of code inside the blockifs condition. It's fine if enclosed by blockifs as you found.
              Norman - www.drillpine.biz
              Edinburgh, U K / Bitez, Turkey

              Comment


                #8
                Ah, right. I wouldn't even dream of putting it there but I can see how it's good to make that clear.
                -----------------------------------------

                First Tackle - Fly Fishing and Game Angling

                -----------------------------------------

                Comment

                Working...
                X