/**
  * amol changes
  * Get details of checkout cart items
  */
 function getCheckoutCartItemsDetails()
 {
     // GETTING CART ITEMS
     JLoader::import('cart', JPATH_SITE . DS . 'components' . DS . 'com_quick2cart' . DS . 'models');
     $cartmodel = new Quick2cartModelcart();
     $cart = $cartmodel->getCartitems();
     foreach ($cart as $key => $rec) {
         JLoader::import('product', JPATH_SITE . DS . 'components' . DS . 'com_quick2cart' . DS . 'models');
         $quick2cartModelProduct = new quick2cartModelProduct();
         $cart[$key]['item_images'] = $quick2cartModelProduct->getProdutImages($rec['item_id']);
         $productHelper = new productHelper();
         // Get cart items attribute details
         $cart[$key]['prodAttributeDetails'] = $productHelper->getItemCompleteAttrDetail($rec['item_id']);
         $product_attributes = rtrim($cart[$key]['product_attributes'], ",");
         if (!empty($product_attributes)) {
             // Get Cart Item attribute seleted value
             if ($cart[$key]['product_attributes']) {
                 $db = JFactory::getDBO();
                 $query = $db->getQuery(true);
                 $query->select("`cartitemattribute_id`, `itemattributeoption_id`, `cartitemattribute_name`");
                 $query->from('#__kart_cartitemattributes');
                 $query->where("itemattributeoption_id IN(" . $product_attributes . ")");
                 $query->where(" cart_item_id = " . $cart[$key]['id']);
                 $db->setQuery($query);
                 $cart[$key]['product_attributes_values'] = $db->loadObjectList('itemattributeoption_id');
             }
         }
     }
     return $cart;
 }
Beispiel #2
0
 function SendMailToAdminApproval($prod_values, $item_id, $newProduct = 1)
 {
     $loguser = JFactory::getUser();
     $comquick2cartHelper = new comquick2cartHelper();
     $app = JFactory::getApplication();
     $mailfrom = $app->getCfg('mailfrom');
     $fromname = $app->getCfg('fromname');
     $sitename = $app->getCfg('sitename');
     $params = JComponentHelper::getParams('com_quick2cart');
     $sendto = $params->get('sale_mail');
     $currency = $comquick2cartHelper->getCurrencySession();
     //$params->get('addcurrency');  // @sheha : currency should take from session instead of param
     //$sendto = $mailfrom;
     $multiple_img = array();
     $count = 0;
     $prod_imgs = $prod_values->get('qtc_prodImg', array(), "ARRAY");
     $quick2cartModelProduct = new quick2cartModelProduct();
     $multiple_img = $quick2cartModelProduct->getProdutImages($item_id);
     $body = '';
     // Edit product
     if ($newProduct == 0) {
         $subject = JText::_('COM_Q2C_EDIT_PRODUCT_SUBJECT');
         $subject = str_replace('{sellername}', $loguser->name, $subject);
         $body = JText::_('COM_Q2C_EDIT_PRODUCT_BODY');
         $body = str_replace('{productname}', $prod_values->get('item_name', '', 'RAW'), $body);
         $pod_price = $prod_values->get('multi_cur', array(), "ARRAY");
         $body = str_replace('{price}', $pod_price[$currency], $body);
         $body = str_replace('{sellername}', $loguser->name, $body);
         $body = str_replace('{sku}', $prod_values->get('sku', '', 'RAW'), $body);
         //~ for($i=0; $i < count($multiple_img); $i++)
         //~ {
         //~ print"<pre>"; print_r($multiple_img); die("222882");
         //~ $body	.= '<br><img src="' . JUri::root() . 'images/quick2cart/' . $multiple_img[$i] . '" alt="No image" ><br>';
         //~ }
         if (!empty($multiple_img)) {
             $multiple_img = (array) $multiple_img;
             foreach ($multiple_img as $key => $img) {
                 $body .= '<br><img src="' . JUri::root() . 'images/quick2cart/' . $img[$key] . '" alt="No image" ><br>';
             }
         }
     } else {
         $subject = JText::_('COM_Q2C_PRODUCT_AAPROVAL_SUBJECT');
         $body = JText::_('COM_Q2C_PRODUCT_AAPROVAL_BODY');
         $body = str_replace('{title}', $prod_values->get('item_name', '', 'RAW'), $body);
         $body = str_replace('{sellername}', $loguser->name, $body);
         $desc = $prod_values->get('description', '', 'ARRAY');
         $desc = strip_tags(trim($desc['data']));
         $body = str_replace('{des}', $desc, $body);
         $body = str_replace('{link}', JUri::base() . 'administrator/index.php?option=com_quick2cart&view=products&filter_published=0', $body);
         for ($i = 0; $i < count($multiple_img); $i++) {
             $body .= '<br><img src="' . JUri::ROOT() . 'images/quick2cart/' . $multiple_img[$i] . '" alt="No image" ><br>';
         }
     }
     $res = $comquick2cartHelper->sendmail($mailfrom, $subject, $body, $sendto);
 }
Beispiel #3
0
 /**
  * Save attribute
  *
  * @param   integer  $item_id    item_id
  * @param   string   $allAttrib  allAttrib
  * @param   string   $sku        sku
  * @param   string   $client     client
  *
  * @return  OBJECT.
  *
  * @since   1.6
  */
 public function saveAttribute($item_id, $allAttrib, $sku, $client)
 {
     JLoader::import('product', JPATH_SITE . '/components/com_quick2cart/models');
     $model = new quick2cartModelProduct();
     $result = $model->StoreAllAttribute($item_id, $allAttrib, $sku, $client);
     return $result;
 }