Jump to content

wstar

Members
  • Posts

    38
  • Joined

  • Last visited

Profile Information

  • First Name
    Jerrod
  • Last Name
    Davenport

wstar's Achievements

Newbie

Newbie (1/14)

0

Reputation

2

Community Answers

  1. I was thinking that too. I did a paste and copy from the FTP. Any folder I put the file into, gives me a 404 page. Like its trying to redirect or something.
  2. I wanted to run a file in the directory as follows: Prestashop_Root/scripts/test.php When i run this in the browser, I get a 404 page error. However, when I move the file to the root, it runs fine. What would be causing this? htaccess?
  3. I have a module which displays a color / size matrix at the bottom of product pages for bulk ordering. Can be seen at the bottom of this page: http://allamericanswim.com/rise-aquatics-guard/39766-guard-poly-v-back-tankini.html It was working great for the last couple weeks when a customer called and said the products where not adding to the cart when using the matrix layout. So I tested it on another computer and indeed there is an issue. My module needs the cart id to add the products into the cart. But the cart id is zero, thus not adding to the cart. If I already have a product in my cart, the module works fine and adds to the cart. Why would cart id be zero? The module uses hookDisplayFooterProduct to display the matrix. To get the cart id, i use: $context = Context::getContext(); $cartID = (int)$context->cookie->id_cart; Sometimes this id_cart is zero. Does prestashop not generate a cart_id on every visitor? How can I get a cart_id to add products to the cart? I have tried the following: if (!$cartID) { $cart = new Cart(); $cart->id_customer = (int)($context->cookie->id_customer); $cart->id_address_delivery = (int) (Address::getFirstCustomerAddressId($cart->id_customer)); $cart->id_address_invoice = $cart->id_address_delivery; $cart->id_lang = (int)($context->cookie->id_lang); $cart->id_currency = (int)($ontext->cookie->id_currency); $cart->id_carrier = 1; $cart->recyclable = 0; $cart->gift = 0; $cart->save(); $cartID = $cart->id; } Which does indeed generate a cart_id but I don't think its saving to the sessions as no products are added to the cart either. Plus when this code is used, multiple computers have the same cart_id. Any pointers? Thanks in advanced.
  4. Having trouble getting the cart ID for the current user in a module I'm creating. Currently, I'm getting the product being viewed by $productID = (int)Tools::getValue('id_product'); However, Im trying the following code and not getting anything. All variables are empty. $context = Context::getContext(); $cartID = Context::getContext()->cart->id_cart; $cartID2 = Tools::getValue('id_cart'); $cartID3 = $this->context->cart->id_cart; $cartID4 = (int)$context->cookie->id_cart; $shopID5 = Shop::getContextShopID(); Any suggestion?
  5. I'm making a module which adds a matrix view of a products with color and size options. I created a new button which loops through the matrix fields looking for quantities and adding to the cart. So far everything is going well but for a couple things. When the products are added to the cart, the cart images all show the base image. Example, the base product has a red image. When I add the blue product, the cart shows the red image. But the description shows it added blue. You can check out this page and scroll down to the very bottom where the matrix is. Add a few different colors. Then check your cart. The product images are all the same color (red). http://swimmersmall.com/rise-aquatics-guard/82119-facility-staff-poly-female-h-2-back.html The ajax code im using to add the products is just ajaxCart.add($(this).data('product'), $(this).data('combination'), false, null, $(this).val(), null); My next question may be a little harder. I want to change the popup after adding to the cart. How can I go about making my own popup after the button is pressed. instead of the default one?
  6. I created a module which displays right under the product description on the product page. I wanted to show a matrix view of color / size. I got the general matrix to show, but I'm having issues gathering data on the product. I've been looking at product.tpl for examples and such. Is there anyway to access the product class information from my module? I just need to loop through the product attribute combinations to populate the matrix (color / size). RIght now Im using the hook "hookDisplayFooterProduct" to display my tpl file. Any help would be great! Thanks for any info.
  7. Prestashop: Version 1.6.1.2 When viewing a product and selecting various product combinations, clicking the back button on the browser window keeps you on the same page but goes back in the combinations selected. Is there a way to have prestashop stop adding each product combination to the back button history? Example: http://thelifeguardstore.com/speedo-guard/1663-lifeguard-super-proback.html Step One: Select a color Step Two: Select a Size Step Three: Select a DIFFERENT size Step Four: Press the back button on the browser. It goes back to STEP TWO instead of out of the product. I have read on some forums here which state this is a default feature when the Black Layered Navigation is active, But this module is not installed. Any suggestions?
  8. I'm trying to add a new link so the product page. On the right where the ADD TO CART button is. Im currently using the "displayProductButtons" hook, but it shows under the button (image attached). I need the new link to be above the product attributes (noted in the image also). Any ideas?
  9. Is there a way to override the product.tbl file which prestashop uses to display a product? Also, why is the ProductController.php not being overridden?
  10. Still a little new to prestashop. Only been making modules for a few months, but this is my 4th module and for some reason I can not get the override working. I'm trying to change the template files being loaded for product.tbl. The module installs perfectly. So far, this is my file structure. lgs_matrix (main module folder)classes controllers overridecontrollersfrontProductController.php css js process storage viewstemplatesadmin frontproduct.tpl So I've seen this code on a few modules before. Within the override controller, they have code like this (in ProductController.php). class ProductController extends ProductControllerCore { public function getMatrixTemplateDir() { return _PS_MODULE_DIR_ . 'lgs_matrix/views/templates/front/'; } // END public function getMatrixTemplateDir() { public function setTemplate($template) { if (!Module::isEnabled('lgs_matrix')) { return parent::setTemplate($template); } if (substr($template, -11) == 'product.tpl') { return parent::setTemplate($this->getMatrixTemplateDir() . 'product.tpl'); } return parent::setTemplate($template); } // END public function setTemplate($template) { } // END class ProductController extends ProductControllerCore { The last function just switches the product.tpl directories to the modules version. As of right now, the product.tpl is identical to the default one, but for a border around the middle container. I did this to see if its loading. After several tries, I can not seem to get it working. Clearing cache did not work. I have even inserted this code into the functions of the module. echo "<script type=\"application/javascript\">console.log(\"LGS ERROR 1\")</script>"; I see on the console the message everywhere BUT in the override controller. Do I have something wrong? Pointer or tips? Thanks for any help/
  11. We are trying to adjust the shipping email to show one of our custom numbers in the database. I know how to edit the email (both through the BO and on the file itself). But where are teh variables generated for the email? For example, Your order with the reference <span>{order_name}</span> has been shipped. Where is {order_name} generated?
  12. ndiaga, Thanks for the suggestion, however, that did not work either. I started looking into the admin index.php file. And noticed I was not declaring _PS_ADMIN_DIR_ PS_ADMIN_DIR Once I declared these, my variables came in. Thanks for all the help!
×
×
  • Create New...