Hi guys,
I have a problem i'm trying to solve but hitting a brick wall at the moment, I'm sure its probably very simple for someone that has the background knowledge..
Basically, I have a script that is pulling all the relevant details from my orders to put into an xml generator script.
For it to work for me, I need to manipulate my product codes based on option values selected by the customer, however, some products have dropdown attributes which get passed into the orders_products_attributes table but products with text only attributes do not populate this table.
Hereth comes my problem,
For products with the selectable attributes the following would have to happen:
if small (model 1000) is selected
I need it to be 1000S
if a medium (model 1000) is selected
I need it to be 1000M
if a model with text attribute is selected (model 1001)
I need it to stay 1001
So my loop basically finds the ordered products and finds in the orders_products_attributes the associated options value id (if it exists) to echo the result. from this I then use the result to minipulate the code with the following:
Break down:PHP Code:if ($ordersproductsattributes == '4')
{
$fullprodid = $prodmod."S";
}
elseif ($ordersproductsattributes == 5)
{
$fullprodid = $prodmod."M";
}
elseif ($ordersproductsattributes == 6)
{
$fullprodid = $prodmod."L";
}
else
$fullprodid = $prodmod;
echo "FULL CODE: $fullprodid";
$ordersproductsattributes is the option value id
$prodmod is the product model
$fullprodid is the full output I want
I thought that the last line I have here would do what I needed it to do, is in:
else
$fullprodid = $prodmod;
so if none of the above apply, $fullprodid will equal the product model. However it would seem that because there is no value for the text attributes in the orders_products_attributes table, its missing these out.
Its almost like I need something to say,
if this ordered product has an option value id in orders_products_attributes table then do this, otherwise do this instead???
That probably makes no sense but i'm hoping it will to someone. I'm sure its probably something very basic that would fix it too, but i'm in over my head
Any Help would be much appreciated.
Cheers
Phil





