<?php /** * @package E-Commerce WD * @author Web-Dorado * @copyright (C) 2014 Web-Dorado. All rights reserved. * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html **/ defined('_JEXEC') || die('Access Denied'); WDFHelper::add_css('css/' . WDFInput::get_controller() . '/' . $this->_layout . '.css'); WDFHelper::add_script('js/' . WDFInput::get_controller() . '/' . $this->_layout . '.js'); $options = $this->options; $final_checkout_data = $this->final_checkout_data; $products_data = $final_checkout_data['products_data']; $total_price_text = $final_checkout_data['total_price_text']; $payment_buttons_data = $this->payment_buttons_data; $pager_data = $this->pager_data; WDFDocument::set_title(WDFText::get('CHECKOUT')); ?> <form name="wd_shop_main_form" action="" method="POST"> </form> <div class="container"> <div class="row"> <div class="col-sm-12"> <!-- panel --> <div class="wd_shop_panel_user_data panel panel-default"> <div class="panel-body"> <h2 class="wd_shop_header"> <?php
$active_class = 'active'; for ($i = 0; $i < count($images); $i++) { $image = $images[$i]; ?> <li class="<?php echo $active_class; ?> "> <a class="btn btn-link"> <div class="wd_center_wrapper"> <div> <img src="<?php echo $image; ?> " data-src="<?php echo JURI::root() . WDFHelper::get_image_original_url($image); ?> "> </div> </div> </a> </li> <?php $active_class = ''; } ?> </ul> </div> </div> <?php //- FT 2015.10.11
private function add_product_related_products($product_rows) { $db = JFactory::getDbo(); $query = $db->getQuery(true); for ($i = 0; $i < count($product_rows); $i++) { $product_row = $product_rows[$i]; $query->clear(); $query->select('T_PRODUCTS.id'); $query->select('T_PRODUCTS.name'); $query->select('T_PRODUCTS.images'); $query->from('#__ecommercewd_products AS T_PRODUCTS'); $query->where('T_PRODUCTS.category_id = ' . $product_row->category_id); $query->where('T_PRODUCTS.id <> ' . $product_row->id); $query->where('T_PRODUCTS.published = 1'); $query->order('RAND() LIMIT 0, 15'); $db->setQuery($query); $related_product_rows = $db->loadObjectList(); if ($db->getErrorNum()) { return false; } // add data foreach ($related_product_rows as $related_product_row) { // link $related_product_row->link = JRoute::_('index.php?option=com_' . WDFHelper::get_com_name() . '&controller=products&task=displayproduct&product_id=' . $related_product_row->id); // image $related_product_row->images = WDFJson::decode($related_product_row->images); $related_product_row->image = count($related_product_row->images) > 0 ? $related_product_row->images[0] : ''; } $product_row->related_products = $related_product_rows; } }
private function get_category_products($category_id, $count) { $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select('id'); $query->select('name'); $query->select('images'); $query->from('#__ecommercewd_products'); $query->where('category_id = ' . $category_id); $query->where('published = 1'); $query->order('ordering ASC'); if ($count) { $db->setQuery($query, 0, $count); } else { $db->setQuery($query); } $rows = $db->loadObjectList(); if ($db->getErrorNum()) { return false; } // additional data foreach ($rows as $row) { // url $row->url = JRoute::_('index.php?option=com_' . WDFHelper::get_com_name() . '&controller=products&task=displayproduct&product_id=' . $row->id); // image $row->images = WDFJson::decode($row->images); $row->image = empty($row->images) == false ? $row->images[0] : ''; } return $rows; }
?> ; var wdShop_minicart = "<?php echo Juri::base() . 'index.php?option=com_' . WDFHelper::get_com_name() . '&controller=shoppingcart&task=displayminicart&tmpl=component'; ?> "; var wdShop_minicart_js_path = "<?php echo WDFUrl::get_site_url() . 'modules/mod_ecommercewd_minicart/js/main.js'; ?> "; var wdShop_urlAddToShoppingCart = "<?php echo WDFUrl::get_site_url() . 'index.php?option=com_' . WDFHelper::get_com_name() . '&controller=shoppingcart&task=add'; ?> "; var wdShop_urlDisplayShoppingCart = "<?php echo JRoute::_('index.php?option=com_' . WDFHelper::get_com_name() . '&controller=shoppingcart&task=displayshoppingcart'); ?> "; var wdShop_amount_in_stock = <?php echo $product_row->amount_in_stock; ?> ; var wdShop_product_unlimited = <?php echo $product_row->unlimited; ?> ; var wdShop_currency_code = "<?php echo $row_default_currency->sign; ?> "; var wdShop_currency_position = "<?php
private function sent_review_notification_email($product_id) { $app = JFactory::getApplication(); $joomla_config = JFactory::getConfig(); $db = JFactory::getDbo(); $query = $db->getQuery(true); $model_options = WDFHelper::get_model('options'); $options = $model_options->get_options(); // get admin email $admin_email = $options->registration_administrator_email; //get product row $product_row = WDFHelper::get_model()->get_product_view_product_row($product_id); // mail data $mail_data = array(); $mail_data['mailfrom'] = JMailHelper::isEmailAddress($admin_email) == true ? $admin_email : $joomla_config->get('mailfrom'); $mail_data['sitename'] = $joomla_config->get('sitename'); $mail_data['subject'] = WDFText::get('EMAIL_REVIEW_NOTIFICATION_TO_ADMIN'); $mail_data['body'] = WDFText::get('EMAIL_REVIEW_NOTIFICATION_TO_ADMIN_BODY', $product_row->name, $mail_data['sitename']); //send mail to admins $query->clear(); $query->select('name'); $query->select('email'); $query->select('sendEmail'); $query->from('#__users'); $query->where('sendEmail = 1'); $db->setQuery($query); $admin_rows = $db->loadObjectList(); foreach ($admin_rows as $admin_row) { WDFMail::send_mail($mail_data['mailfrom'], $admin_row->email, $mail_data['subject'], $mail_data['body'], true); } }