Well the payment gateway expects a form within an iframe, but I will modify it to process the data using curl ...Originally Posted by zamzom
Well the payment gateway expects a form within an iframe, but I will modify it to process the data using curl ...Originally Posted by zamzom
I need to use a hidden field with image location. I am trying to submit current cart data into a form using curl, I found the array $orders->products[i] where i has different product information(id, name, qty, price), but I couldn't find out from where I can get the image location to pass it as a hidden field using zen_draw_hidden_field() function, I am trying to mimic the exact display of the shopping cart, onto the processing server, so I have everything else but the image location. to display the thumbnail. Any recommendations?
Qty Product Name Description and Price are all available from the Order Class, but there is no image location in that array ...
This module will use curl to pass the cart data(Image Qty Product Name Description and Price) plus the username, it will loop through the order.
Last edited by icecold; 15 Mar 2010 at 08:33 AM.
The image is not part of the available data provided during checkout. If you need that, you'll have to query for it.
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
ok, I see but then where this code is generated?
<span id="cartImage" class="back"><img src="images/isimages/DH00789BLK.jpg" ...
I couldn't find what includes are used to show this info ... any particular zen-cart function or Class I need to look?
I searched the code in shopping_cart and orders classes, to see if the values where queried from a function there, but couldn't find anything.
In v1.3.x, the shopping_cart class doesn't draw the content for the shopping cart *page*. The class merely manages shopping cart operations, not view activities.
The image for the shopping cart *page* is obtained inside the controller for that page: /includes/modules/pages/header_php.php
That code is not replicated in the shopping_cart or order classes because it is not needed there. ie: There's no need to store that info in the order records, so there's no need to process that information at that stage.
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
ok, I found it in tpl_shopping_cart, I completely forgot, about the templates controlling html output ...
so now my question is
I noticed a foreach loop using $ProductsArray (don't know if that var is defined somewhere)
So, it's ok to request $products['productsImage'] and use it as hidden field?PHP Code:foreach ($productArray as $product) {
?>
<tr class="<?php echo $product['rowClass']; ?>">
<td class="cartQuantity">
<?php
if ($product['flagShowFixedQuantity']) {
echo $product['showFixedQuantityAmount'] . '<br /><span class="alert bold">' . $product['flagStockCheck'] . '</span><br /><br />' . $product['showMinUnits'];
} else {
echo $product['quantityField'] . '<br /><span class="alert bold">' . $product['flagStockCheck'] . '</span><br /><br />' . $product['showMinUnits'];
}
?>
</td>
<td class="cartQuantityUpdate">
<?php
if ($product['buttonUpdate'] == '') {
echo '' ;
} else {
echo $product['buttonUpdate'];
}
?>
</td>
<td class="cartProductDisplay">
<a href="<?php echo $product['linkProductsName']; ?>"><span id="cartImage" class="back"><?php echo $product['productsImage']; ?></span><span id="cartProdTitle"><?php echo $product['productsName'] . '<span class="alert bold">' . $product['flagStockCheck'] . '</span>'; ?></span></a>
<br class="clearBoth" />
<?php
echo $product['attributeHiddenField'];
if (isset($product['attributes']) && is_array($product['attributes'])) {
echo '<div class="cartAttribsList">';
echo '<ul>';
reset($product['attributes']);
foreach ($product['attributes'] as $option => $value) {
?>
<li><?php echo $value['products_options_name'] . TEXT_OPTION_DIVIDER . nl2br($value['products_options_values_name']); ?></li>
<?php
}
echo '</ul>';
echo '</div>';
}
?>
</td>
<td class="cartUnitDisplay"><?php echo $product['productsPriceEach']; ?></td>
<td class="cartTotalDisplay"><?php echo $product['productsPrice']; ?></td>
<td class="cartRemoveItemDisplay">
or I have to do a foreach ... also in my module?
The template is rendering the View portion of the controller content built in the header_php.php I talked about earlier.
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
Yes I saw that in header:
My question was if it's ok to call the array $productArray directly (as the vars are on the same shopping cart, that page), or I have to do a foreach $productArray as $products ... again?PHP Code:$productArray[$i] = array('attributeHiddenField'=>$attributeHiddenField,
'flagStockCheck'=>$flagStockCheck,
'flagShowFixedQuantity'=>$showFixedQuantity,
'linkProductsImage'=>$linkProductsImage,
'linkProductsName'=>$linkProductsName,
'productsImage'=>$productsImage,
'productsName'=>$productsName,
'showFixedQuantity'=>$showFixedQuantity,
'showFixedQuantityAmount'=>$showFixedQuantityAmount,
'showMinUnits'=>$showMinUnits,
'quantityField'=>$quantityField,
'buttonUpdate'=>$buttonUpdate,
'productsPrice'=>$productsPrice,
'productsPriceEach'=>$productsPriceEach,
'rowClass'=>$rowClass,
'buttonDelete'=>$buttonDelete,
'checkBoxDelete'=>$checkBoxDelete,
'id'=>$products[$i]['id'],
'attributes'=>$attrArray);
Well, if you're not *on* the shopping cart page when you're running your particular code, then that whole array won't even be available to you, so you won't be able to use the variables at all.
But, assuming you were on that page, if you think about it, the foreach is used to render each line in the shopping cart. So, unless you're already doing something as part of looping thru the array within the template, you'll have to loop thru it again if you want it to handle *all* products in the cart.
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
To be a bit more specific I meant
$process_button zen_draw_hidden_field('image', $products->products['productImage']) ...