Hello
Our PHP has to be updated on the miva server in which I will loose my database connection to check to see if a product variant is set up for Specific Pricing. I have an automated price update that updates all products on my miva site but some of our products are set up using a product variant using the Specific Pricing Option.
I do not see using the Rest call ProductVariantList_Load_Product to see if this option is enabled.
I check it with this select statement
#This qry checks to see if there is a specific pricing product variant
$ProdVarQry = "Select * From s01_ProductVariantPricing Where s01_ProductVariantPricing.product_id = '$ParentProdId' and method = 1"
I need to check it to make sure that it is set up this way because I send the Function = 'Provision_Store' with an xml payload to update the specific pricing
PRodVarPricing.JPG
if($ParentProdCode -eq 'Unit' -Or $ParentProdCode -eq 'Quantity' -Or $ParentProdCode -eq 'UM' ){
$AttBuild += "<Attribute_Option attribute_code='$ParentProdCode' option_code='$Unit' />"
}
Else{
$AttBuild += "<Attribute_Option attribute_code='$ParentProdCode' option_code='$code' />"
}
#Ending for ForEach on $dataSetPPID
}
$body = @{
Store_Code = $storeCode
Function = 'Provision_Store'
xml = "<ProductVariant_Update product_code=$ProdVar>
<Options>
$AttBuild
</Options>
<ProductVariantPricing>
<Method>specific</Method>
<Price>$ProductsPrice</Price>
<Weight>$UnitWeight</Weight>
</ProductVariantPricing>
</ProductVariant_Update>"
}
if ( $includeTimestamp ){
$body["Miva_Request_Timestamp"] = [DateTimeOffset]::Now.ToUnixTimeSeconds()
}
I need a solution for this check since I am loosing my DB connection.
Our PHP has to be updated on the miva server in which I will loose my database connection to check to see if a product variant is set up for Specific Pricing. I have an automated price update that updates all products on my miva site but some of our products are set up using a product variant using the Specific Pricing Option.
I do not see using the Rest call ProductVariantList_Load_Product to see if this option is enabled.
I check it with this select statement
#This qry checks to see if there is a specific pricing product variant
$ProdVarQry = "Select * From s01_ProductVariantPricing Where s01_ProductVariantPricing.product_id = '$ParentProdId' and method = 1"
I need to check it to make sure that it is set up this way because I send the Function = 'Provision_Store' with an xml payload to update the specific pricing
PRodVarPricing.JPG
if($ParentProdCode -eq 'Unit' -Or $ParentProdCode -eq 'Quantity' -Or $ParentProdCode -eq 'UM' ){
$AttBuild += "<Attribute_Option attribute_code='$ParentProdCode' option_code='$Unit' />"
}
Else{
$AttBuild += "<Attribute_Option attribute_code='$ParentProdCode' option_code='$code' />"
}
#Ending for ForEach on $dataSetPPID
}
$body = @{
Store_Code = $storeCode
Function = 'Provision_Store'
xml = "<ProductVariant_Update product_code=$ProdVar>
<Options>
$AttBuild
</Options>
<ProductVariantPricing>
<Method>specific</Method>
<Price>$ProductsPrice</Price>
<Weight>$UnitWeight</Weight>
</ProductVariantPricing>
</ProductVariant_Update>"
}
if ( $includeTimestamp ){
$body["Miva_Request_Timestamp"] = [DateTimeOffset]::Now.ToUnixTimeSeconds()
}
I need a solution for this check since I am loosing my DB connection.
Comment