Announcement

Collapse
No announcement yet.

custom property location help

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

    custom property location help

    hi, i am trying to locate where actinic stores the custom property's values in the database.

    it does not seem to be in the product table of the database

    also codepaths soapbox plugin, any idea where the reviews are stored

    kind regards
    wes
    Treasure Island Sweets

    #2
    Originally posted by wesleythorne View Post
    hi, i am trying to locate where actinic stores the custom property's values in the database.

    it does not seem to be in the product table of the database

    also codepaths soapbox plugin, any idea where the reviews are stored

    kind regards
    wes
    All the values of custom variables are held in 'UserDefinedProperties', you need to use the info in the table 'variables' to understand the information in the 'UserDefinedProperties' table.

    Soapbox reviews are run from their website.

    Malcolm

    SellerDeck Accredited Partner,
    SellerDeck 2016 Extensions, and
    Custom Packages

    Comment


      #3
      The Cvs are stored in different tables and linked to the product. When you export the catalog you will see that the CVs are however added to end of the Product rows.

      Comment


        #4
        Here's some example code that gets a product level Variable's contents. Intended for use when you know the ProductID.

        You can extract the bits of SQL and use them outside of Actinic.

        Several methods shown.

        1)
        Code:
        <actinic:block php="true" > 
        	// two step method get UDP 'My_Variable'
        	$connect = odbc_pconnect("ActinicCatalog<actinic:variable name="ECMajorVersion" selectable="false" />","","", SQL_CUR_USE_ODBC); 
        
        	$query = "SELECT nID from Variable WHERE sName='My_Variable'";
        	$result = odbc_exec($connect, $query); 
        	$my_variable_id = odbc_result($result, 1);
        	
        	$query = "SELECT sValue, nVariableID FROM UserDefinedProperties 
        			WHERE sContentID='<actinic:variable name="ProductID" encoding="perl" selectable="false" />' 
        				AND nVariableID=$my_variable_id";
        	$result = odbc_exec($connect, $query); 
        	odbc_fetch_row($result);
        	$my_variable = odbc_result($result, 1);
        
        	echo "We got: $my_variable";
        	odbc_close_all();   
        </actinic:block>
        2) Might be slower?
        Code:
        <actinic:block php="true" > 
        	// one step method get UDP 'My_Variable'
        	$connect = odbc_pconnect("ActinicCatalog<actinic:variable name="ECMajorVersion" selectable="false" />","","", SQL_CUR_USE_ODBC); 
        
        	$query = "SELECT UserDefinedProperties.sValue, UserDefinedProperties.nVariableID FROM UserDefinedProperties 
        			INNER JOIN Variable ON Variable.nID=UserDefinedProperties.nVariableID
        				WHERE Variable.sName='My_Variable' AND UserDefinedProperties.sContentID='<actinic:variable name="ProductID" enconding="perl" selectable="false" />'";
        	$result = odbc_exec($connect, $query); 
        	odbc_fetch_row($result);
        	$my_variable = odbc_result($result, 1);
        	echo "We got: $my_variable";
        	odbc_close_all();   
        </actinic:block>
        3) Example real world code that gets a group of like named variables of type Filename
        Code:
        	// two step method get LightBoxImage1 .. LightBoxImage10
        	$connect = odbc_pconnect("ActinicCatalog<actinic:variable name="ECMajorVersion" selectable="false" />","","", SQL_CUR_USE_ODBC); 
        	$LightBoxImages = array();
        	for ($i=1; $i<=10; $i++)
        		{
        		$query = "SELECT nID from Variable WHERE sName='LightboxImage$i'";
        		$result = odbc_exec($connect, $query); 
        		$variableID = odbc_result($result, 1);
        		$query = "SELECT sValue, nID FROM UserDefinedProperties" 
        				 . " WHERE sContentID='<actinic:variable name="ProductID" encoding="perl" selectable="false" />'" 
        				 . " AND nVariableID=$variableID";
        		$result = odbc_exec($connect, $query); 
        		odbc_fetch_row($result);
        		$lbimage = odbc_result($result, 1);
        		$LightBoxImages[] = str_replace('\\', '/', $lbimage);
        		}
        	odbc_close_all();
        Norman - www.drillpine.biz
        Edinburgh, U K / Bitez, Turkey

        Comment


          #5
          thanks will let you know how it goes
          Treasure Island Sweets

          Comment

          Working...
          X