Example #1
0
</a>
    </td>
  </tr>
  <tr>
    <td align="left" nowrap ><?php 
echo $product_price;
?>
</td>
  </tr>
  <tr>
    <td ><a href="<?php 
echo $product_flypage;
?>
">
          <?php 
echo ps_product::image_tag($product_thumb_image, 'class="browseProductImage" border="0" title="' . $product_name . '" alt="' . $product_name . '"');
?>
       </a>
    </td>
  </tr>
  <tr>
    <td height="80" valign="top"><?php 
echo $product_s_desc;
?>
<br />
      <a style="font-size: 9px; font-weight: bold;" href="<?php 
echo $product_flypage;
?>
">[<?php 
echo $product_details;
?>
Example #2
0
  <h3 class="ice-title"> <a <?php 
echo $target;
?>
  href="<?php 
echo $row->link;
?>
" title="<?php 
echo $row->title;
?>
"><?php 
echo $row->title;
?>
</a> </h3>
  <div class="ice-vmimagearea">
    <p><?php 
echo ps_product::image_tag($row->product_thumb_image, "alt=\"" . $row->product_name . "\"");
?>
</p>
    <span class="ice-pprice">
    <?php 
global $iceps_product;
if (!$iceps_product) {
    $iceps_product = new ps_product();
}
echo $iceps_product->show_price($row->product_id, true, false);
?>
    </span>
    <?php 
if (!trim(ps_product::product_has_attributes($row->product_id, true))) {
    ?>
    <div class="ice-addtocart">
Example #3
0
 /**
  * Builds a list of all additional images
  *
  * @param int $product_id
  * @param array $images
  * @return string
  */
 function vmlistAdditionalImages($product_id, $images, $title = '', $limit = 1000)
 {
     global $sess;
     $html = '';
     $i = 0;
     foreach ($images as $image) {
         $thumbtag = ps_product::image_tag($image->file_name, 'class="browseProductImage"', 1, 'product', $image->file_image_thumb_width, $image->file_image_thumb_height);
         $fulladdress = $sess->url('index2.php?page=shop.view_images&amp;image_id=' . $image->file_id . '&amp;product_id=' . $product_id . '&amp;pop=1');
         if ($this->get_cfg('useLightBoxImages', 1)) {
             $html .= vmCommonHTML::getLightboxImageLink($image->file_url, $thumbtag, $title ? $title : stripslashes(htmlentities($image->file_title, ENT_QUOTES)), 'product' . $product_id);
         } else {
             $html .= vmPopupLink($fulladdress, $thumbtag, 640, 550);
         }
         $html .= ' ';
         if (++$i > $limit) {
             break;
         }
     }
     return $html;
 }
	
	<td align="center" width="<?php 
    echo $cellwidth;
    ?>
%" >
		<br />
         <a title="<?php 
    echo $category["category_name"];
    ?>
" href="<?php 
    $sess->purl(URL . "index.php?option=com_virtuemart&amp;page=shop.browse&amp;category_id=" . $category["category_id"]);
    ?>
"> 
			<?php 
    if ($category["category_thumb_image"]) {
        echo ps_product::image_tag($category["category_thumb_image"], "alt=\"" . $category["category_name"] . "\"", 0, "category");
        echo "<br /><br/>\n";
    }
    echo $category["category_name"];
    echo $category['number_of_products'];
    ?>
		 </a><br/>
	</td>
	
	
	<?php 
    // Do we need to close the current row now?
    if ($iCol == $categories_per_row) {
        // If the number of products per row has been reached
        echo "</tr>\n";
        $iCol = 1;
			<?php 
    echo $featured['product_price'];
    ?>
<br />
            <?php 
    if ($featured["product_thumb"]) {
        ?>
                <a title="<?php 
        echo $featured["product_name"];
        ?>
" href="<?php 
        $sess->purl(URL . "index.php?option=com_virtuemart&amp;page=shop.product_details&amp;flypage=" . $featured["flypage"] . "&amp;product_id=" . $featured["product_id"]);
        ?>
"> 
				<?php 
        echo ps_product::image_tag($featured["product_thumb"], "class=\"browseProductImage\" border=\"0\" alt=\"" . $featured["product_name"] . "\"");
        ?>
</a><br /><br/>
            <?php 
    }
    ?>
            <?php 
    echo $featured['product_s_desc'];
    ?>
<br />
            
            <?php 
    echo $featured['form_addtocart'];
    ?>
	</div>
	<?php 
Example #6
0
// Creates a new HTML_Table object that will help us
// to build a table holding all the products
$table = new HTML_Table('width="100%"');
$table->addRow($tableheader, 'class="sectiontableheader"', 'th', true);
foreach ($products as $product) {
    foreach ($product as $attr => $val) {
        // Using this we make all the variables available in the template
        // translated example: $this->set( 'product_name', $product_name );
        $this->set($attr, $val);
    }
    $data[$row][] = '<a href="' . $product['product_flypage'] . '" title="' . $product['product_name'] . '">' . $product['product_name'] . '</a>';
    $data[$row][] = $product['product_sku'];
    if (_SHOW_PRICES && $auth['show_prices']) {
        $data[$row][] = $product['product_price'];
    }
    $data[$row][] = '<a href="' . $product['product_flypage'] . '" title="' . $product['product_name'] . '">' . ps_product::image_tag($product['product_thumb_image']) . '</a>';
    $data[$row][] = $product['product_s_desc'];
    if ($product['has_addtocart']) {
        $data[$row][] = $product['form_addtocart'];
    } else {
        $data[$row][] = '<a href="' . $product['product_flypage'] . '" title="' . $product['product_name'] . '">' . $product['product_details'] . '</a>';
    }
    $row++;
}
// Loop through each row and build the table
foreach ($data as $key => $value) {
    $table->addRow($data[$key], 'class="sectiontableentry' . $i . '"', 'td', true);
    $i = $i == 1 ? 2 : 1;
}
// Display the table
echo $table->toHtml();
 public function process_payment()
 {
     global $db;
     $order_id = $db->f("order_id");
     $amount = $db->f("order_total");
     $order = $this->getOrderInfo($order_id);
     $success_url = SSL_URL . '/' . RESULTPATH . '?status=success';
     $result_url = SSL_URL . '/' . RESULTPATH . '?status=done';
     $i = 0;
     $amount2 = 0;
     $product_count = 0;
     $products_items = $this->getProducts($order_id);
     if ($products_items) {
         foreach ($products_items as $key => $pr_item) {
             $product = $this->getProduct($pr_item->order_item_id);
             if ($product_image = ps_product::image_tag($product[0]->product_full_image, '', 0)) {
                 if (preg_match('/src="([^"]*)"/', $product_image, $matches)) {
                     $products[$i]['ImageUrl'] = $matches[1];
                 }
             }
             $products[$i]['ProductItemsNum'] = number_format($pr_item->product_quantity, 2, '.', '');
             $products[$i]['ProductName'] = $pr_item->order_item_name;
             $products[$i]['ProductPrice'] = number_format($pr_item->product_item_price, 2, '.', '');
             $products[$i]['ProductId'] = $pr_item->order_item_id;
             $amount2 += $pr_item->product_item_price;
             $product_count += $pr_item->product_quantity;
             $i++;
         }
     }
     if ($amount != $amount2) {
         $tt = $amount - $amount2;
         $products[$i]['ProductItemsNum'] = '1.00';
         $products[$i]['ProductName'] = 'Delivery or discount';
         $products[$i]['ProductPrice'] = number_format($tt, 2, '.', '');
         $products[$i]['ProductId'] = '00001';
         $pr_c = '1.00';
         $amount2 = number_format($amount2 + $tt, 2, '.', '');
     }
     $user_id = $order->user_id < 1 ? $order->user_id : 1;
     $signature_u = md5(md5($this->merchantGuid . $this->merchnatSecretKey . $order->order_total . $order_id));
     $phone = isset($order->phone_2) ? $order->phone_2 : $order->phone_1;
     $address = isset($order->address_type_name) ? $order->address_type_name : $order->address_1;
     $paymentDetails = array("MerchantInternalPaymentId" => "{$order_id}", "MerchantInternalUserId" => $user_id, "EMail" => $order->user_email, "PhoneNumber" => $phone, "CustomMerchantInfo" => "{$signature_u}", "StatusUrl" => "{$result_url}", "ReturnUrl" => "{$success_url}", "BuyerCountry" => $order->country, "BuyerFirstname" => $order->first_name, "BuyerPatronymic" => $order->middle_name, "BuyerLastname" => $order->last_name, "BuyerStreet" => $address, "BuyerZone" => "", "BuyerZip" => $order->zip, "BuyerCity" => $order->city, "DeliveryFirstname" => $order->first_name, "DeliveryLastname" => $order->last_name, "DeliveryZip" => $order->zip, "DeliveryCountry" => $order->country, "DeliveryPatronymic" => $order->middle_name, "DeliveryStreet" => $address, "DeliveryCity" => $order->city, "DeliveryZone" => "");
     $product_count = @$pr_c ? $product_count + $pr_c : $product_count;
     $product_count = number_format($product_count, 2, '.', '');
     $amount2 = number_format($amount2, 2, '.', '');
     $selectedPaySystemId = $_SESSION['cc_types'] ? $_SESSION['cc_types'] : "1";
     $signature = md5($this->merchantGuid . "{$amount2}" . "{$product_count}" . $paymentDetails["MerchantInternalUserId"] . $paymentDetails["MerchantInternalPaymentId"] . $selectedPaySystemId . $this->merchnatSecretKey);
     $request = array("SelectedPaySystemId" => $selectedPaySystemId, "Products" => $products, "PaymentDetails" => $paymentDetails, "Signature" => $signature, "MerchantGuid" => $this->merchantGuid, "Currency" => KCURRENCY);
     $res = $this->sendRequestKaznachey($this->urlGetMerchantInfo, json_encode($request));
     $result = json_decode($res, true);
     unset($_SESSION['cc_types']);
     if ($result['ErrorCode'] != 0) {
         return '<div class="error">Произошла ошибка. Попробуйте повторить позднее</div>';
     }
     echo base64_decode($result["ExternalForm"]);
 }