function category_filter($vars) { //set defaults $slug = false; $per_page = config_item('products_per_page'); if (isset($vars[0])) { $slug = $vars[0]; } else { return false; // there is nothing to display } if (isset($vars[1])) { $per_page = $vars[1]; } $categories = \CI::Categories()->get($slug, 'id', 'ASC', 0, $per_page); return View::getInstance()->get('categories/products', $categories); }
public function __construct() { \CI::load()->helper('form'); \CI::load()->library('breadcrumbs'); $this->views = View::getInstance(); }
static function Order($order) { if ($order->is_guest) { //if the customer is a guest, get their name from the Billing address $customerName = $order->billing_firstname . ' ' . $order->billing_lastname; $customerEmail = $order->billing_email; } else { $customerName = $order->firstname . ' ' . $order->lastname; $customerEmail = $order->email; } $cannedMessage = \CI::db()->where('id', '7')->get('canned_messages')->row_array(); $loader = new \Twig_Loader_String(); $twig = new \Twig_Environment($loader); //load in the view class so we can get our order view $view = \GoCart\Libraries\View::getInstance(); $fields = ['customer_name' => $customerName, 'site_name' => config_item('company_name'), 'order_summary' => $view->get('order_summary_email', ['order' => $order])]; $subject = $twig->render($cannedMessage['subject'], $fields); $content = $twig->render($cannedMessage['content'], $fields); $email = \Swift_Message::newInstance(); $email->setFrom(config_item('email_from')); //email address the website sends from $email->setTo($customerEmail); $email->setBcc(config_item('email_to')); //admin email the website sends to $email->setReturnPath(config_item('email_to')); //this is the bounce if they submit a bad email $email->setSubject($subject); $email->setBody($content, 'text/html'); self::sendEmail($email); }
function show_collection($banner_collection_id, $quantity = 5, $theme = 'default') { $data['id'] = $banner_collection_id; $data['banners'] = $this->banner_collection_banners($banner_collection_id, true, $quantity); return \GoCart\Libraries\View::getInstance()->get('banners/' . $theme, $data); }
?> <a class="controls" data-direction="back"><i class="icon-chevron-left"></i></a> <a class="controls" data-direction="forward"><i class="icon-chevron-right"></i></a> <div class="banner-timer"></div> </div> </script> <?php } ?> <?php if (!empty($product->related_products)) { ?> <div class="page-header" style="margin-top:30px;"> <h3><?php echo lang('related_products_title'); ?> </h3> </div> <?php $relatedProducts = []; foreach ($product->related_products as $related) { $related->images = json_decode($related->images, true); $relatedProducts[] = $related; } \GoCart\Libraries\View::getInstance()->show('categories/products', ['products' => $relatedProducts]); ?> <?php }