Ejemplo n.º 1
0
 protected function recoverCart()
 {
     $app = JFactory::getApplication();
     $cart_id = (int) $app->input->get('recover_cart');
     $context = JeproshopContext::getContext();
     $is_cart_token = JeproshopTools::getCartToken() == md5(COM_JEPROSHOP_COOKIE_KEY . 'recover_cart' . $cart_id);
     if ($cart_id && $is_cart_token) {
         $cart = new JeproshopCartModelCart((int) $cart_id);
         if (JeproshopTools::isLoadedObject($cart, 'cart_id')) {
             $customer = new JeproshopCustomerModelCustomer((int) $cart->customer_id);
             if (JeproshopTools::isLoadedObject($customer, 'customer_id')) {
                 $customer->logged = true;
                 $context->customer = $customer;
                 $context->cookie->customer_id = (int) $customer->customer_id;
                 $context->cookie->customer_lastname = $customer->lastname;
                 $context->cookie->customer_firstname = $customer->firstname;
                 $context->cookie->logged = 1;
                 $context->cookie->check_selling_conition = 1;
                 $context->cookie->is_guest = $customer->isGuest();
                 $context->cookie->passwd = $customer->passwd;
                 $context->cookie->email = $customer->email;
                 return $cart_id;
             }
         } else {
             return false;
         }
     }
 }
Ejemplo n.º 2
0
                    <td class="cart_delete">
                        <?php 
                if (isset($cannotModify) and $cannotModify == 1) {
                } else {
                    ?>
                            <div>
                                <a id="<?php 
                    echo $product->product_id . '_' . $product->product_attribute_id . '_' . $customization_id . '_' . $product->address_delivery_id;
                    ?>
"
                                   class="cart_quantity_delete" rel="nofollow" title="<?php 
                    echo JText::_('COM_JEPROSHOP_DELETE_LABEL');
                    ?>
"
                                   href="<?php 
                    echo JRoute::_('index.php?option=com_jeproshop&view=cart&task=delete&product_id=' . (int) $product->product_id . '&product_attribute_id=' . (int) $product->product_attribute_id . '&customization_id=' . (int) $customization_id . '&address_delvery_id=' . (int) $product->address_delivery_id . '&' . JeproshopTools::getCartToken() . '=1', true, 1);
                    ?>
"  >
                                    <i class=" icon-trash"></i>
                                </a>
                            </div>
                        <?php 
                }
                ?>
                    </td>
                </tr>
                <?php 
                $quantityDisplayed = $quantityDisplayed + $customization->quantity;
            }
            /* If it exists also some un-customized products */
            if ($product->quantity - $quantityDisplayed > 0) {
Ejemplo n.º 3
0
                        <?php 
                /*{hook h="displayProductPriceBlock" product=$product type="price"}
                  {hook h="displayProductPriceBlock" product=$product type="unit_price"} **/
                ?>
                        <?php 
            }
            ?>
                    </div>
                    <?php 
        }
        ?>
                    <div class="button-container">
                        <?php 
        if (($product->product_attribute_id == 0 || isset($this->display_add_product) && $this->display_add_product == 1) && $product->available_for_order && !isset($this->restricted_country_mode) && $product->minimal_quantity <= 1 && $product->customizable != 2 && !$this->catalog_mode) {
            if ((!isset($product->customization_required) || !$product->customization_required) && ($product->allow_out_of_stock_ordering || $product->quantity > 0)) {
                $static_token = JeproshopTools::getCartToken();
                if (isset($static_token)) {
                    ?>
                        <a class="button ajax_add_to_cart_button btn btn-default" href="<?php 
                    echo JRoute::_($this->context->controller->getPageLink('cart', false, NULL, 'task=add&product_id=' . (int) $product->product_id . '&' . $static_token . '=1', false));
                    ?>
" rel="nofollow" title="<?php 
                    echo JText::_('COM_JEPROSHOP_ADD_TO_CART_LABEL');
                    ?>
" data-product-id="<?php 
                    echo (int) $product->product_id;
                    ?>
"><span><?php 
                    echo JText::_('COM_JEPROSHOP_ADD_TO_CART_LABEL');
                    ?>
</span></a>