Jump to content

hubbobubbo2

Members
  • Posts

    24
  • Joined

  • Last visited

Profile Information

  • First Name
    Johan
  • Last Name
    Johan

Recent Profile Visitors

182 profile views

hubbobubbo2's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Answering my own question many years later. This is what I got working today for PS 1.7.6. My objective was to export quantities for all products and all combinations. Used one of the suggestions above as starting point. SELECT m.name AS 'Manufacturer', p.id_product 'Product ID', pl.name 'Product Name', IFNULL(pa.reference, p.reference) 'Reference', IFNULL(pa.upc, p.upc) 'Position', IFNULL(pa.ean13, p.ean13) 'EAN13', IFNULL(s.quantity, p.quantity) 'Quantity' FROM ps_product p LEFT JOIN ps_product_lang pl ON (p.id_product = pl.id_product and pl.id_lang=1) LEFT JOIN ps_manufacturer m ON (p.id_manufacturer = m.id_manufacturer) LEFT JOIN ps_category_product cp ON (p.id_product = cp.id_product) LEFT JOIN ps_category c ON (cp.id_category = c.id_category) LEFT JOIN ps_category_lang cl ON (cp.id_category = cl.id_category and cl.id_lang=1) LEFT JOIN ps_product_attribute pa ON (p.id_product = pa.id_product) LEFT JOIN ps_stock_available s ON (p.id_product = s.id_product and pa.id_product_attribute=s.id_product_attribute) LEFT JOIN ps_product_tag pt ON (p.id_product = pt.id_product) LEFT JOIN ps_product_attribute_combination pac ON (pac.id_product_attribute = pa.id_product_attribute) LEFT JOIN ps_attribute_lang al ON (al.id_attribute = pac.id_attribute and al.id_lang=1) GROUP BY p.id_product,pac.id_product_attribute order by p.id_product
  2. @DataKick This does not work for me in PS 1.7.4.0 beta. This line: $path = Tools::getPath('', $this->category->id); Generates the error: (1/1) ContextErrorException Notice: Trying to get property of non-object in Tools.php (line 3997) at ToolsCore::getPath('', 6) Any ideas? I could not find a way to get the base_url either. I am calling the function from a FrontOffice module that previously was working just fine in 1.6 . and 1.6 without the new base_url parameter.
  3. Thanks for the replies. I used bitnami to test on localhost. I have already 1.7.3 running on my server with no problems. Today I reverted to using a plain xampp installation and downloaded PS 1.7.3.1 and installed it and it seems to run fine. I guess this was related to bitnami so I will not use that for now.
  4. Hi I wanted to test 1.7.3.1 locally so I downloaded the package from bitnami. I can access the frontoffice pretty much ok but the backoffice takes over 60 sec to load and chrome shows an error about "waiting for available socket" and when I finally manage to get in, it is completely unresponsive. I have a vanilla installation taken from here: https://bitnami.com/stack/prestashop I would expect it to work out of the box, anyone has any ideas?
  5. Hi I have a module showing a couple of images and I want to use the retina version of them when applicable. If I make the image twice the size and then use height and width in the img tag, it works fine, the image looks great on my retina device. That will however feed the retina version of the image to all devices, also the non-retina ones. How can I make it work so that the 2x image is only served to capable devices? I have tried to just add 2x at the end of the file name but it does not make any difference. I am testing with PS 1.7 and the classic theme.
  6. Thanks for the reply. It seems that my 1.5.x version of Prestashop does not support adding AND or OR inside the JOIN statements. I had this problem before. So I am sure your query is fine but if using these AND/OR in the JOIN is needed I have to wait until I manage to update Prestashop.
  7. Hi I have some problems creating a SQL query to get all products and their current stock quantity. I have managed to get the complete list of all products. The stock level is also right for products with attributes but I can not get the stock level for products without any attributes right. The minimal version of my query is: SELECT p.id_product, pl.name, IF(pa.ean13, pa.ean13, p.ean13) AS EAN13, psa.quantity FROM ps_product p LEFT JOIN ps_product_attribute pa ON (p.id_product = pa.id_product) LEFT JOIN ps_stock_available psa ON (pa.id_product_attribute = psa.id_product_attribute) LEFT JOIN ps_product_lang pl ON (p.id_product = pl.id_product) WHERE pl.id_lang = 1 ORDER BY p.id_product This correctly lists all products and correct stock levels for products with attributes. However, I think because of the second JOIN, it looses the quantity in ps_stock_available for products without attributes. Can anyone help correcting the query so I can see the stock level also for products without attributes?
  8. Ok solved it, just used the same code in the tpl file as in your example. Works just as I wanted. Thanks for the help
  9. Thanks for the reply. I agree this is the correct approach. However in my theme I have 2 css files included in 2 different tpl files for legacy reasons. These are the ones I want to control if they are added or not and I want to change as little as possible so being able to add this extra check in the tpl file would be a very simple solution for now. You say it is possible to do almost the same code from tpl, even if it is not best practice, how would it look like. Thanks again for your help
  10. Thank you very much for these suggestions. I will give it a try and see how it works. Just out of curiosity. You said that using @fontface is recommended over using style. Does the latest versions of Prestashop follow this rule?
  11. Hi I need to check in a .tpl file if CCC is active to know if I am going to include a specific css file or not. Is there an existing way to know this from the presentation layer or would I have to add a new PHP function first? Thanks in advance for any suggestions
  12. To be honest I am not 100% sure what full character set means. The shop needs to support european languages, so standard alphabet accents etc. I guess caching is preferable always right but I guess it depends if we need to sacrifice something else that is more important.
  13. Thanks for the suggestion. I checked here: http://www.w3schools.com/cssref/css3_pr_font-face_rule.asp and it seems as support is a bit random but new browsers should manage it. What is your experience, I just want to use this single google font, should @fontface replace the current approach with style? Does exceptions need to be added for ie6 or other older browsers?
  14. Hi Everytime I run my shop through Google Page Speed insights it complains about this line: <link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Questrial"> Basically it just means that the Google Font is not included in the big CCC file where most of the other css info is. Is there a reason I could not just add this line to the end of bootstrap.css instead for having it as a separate line? Are the fonts somehow treated differently? Anyone has a good answer?
  15. I want to do exactly the same thing, did you find a solution? Anyone has a good idea? I tried to compare Category.tpl loading the home-default image which is the correct one but I fail to be able to load this image from Product.tpl. This is a pretty sensible requirement and I am surprised this is not the default way of working in Prestashop.
×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More