Jump to content
thirty bees forum

ssimard

Members
  • Posts

    162
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by ssimard

  1. We have a Filemaker database and would possibly like to update our online store directly from it. We use it for the internal management of our projects (author rights and the like since we are a publishing company). They would like to reduce the data entering so synchronizing the website from that database would be cool). I know ODBC can be used to access Thirtybees tables but what about image creation, product removal etc.. I fear some mechanisms wont be triggered if I do it that way (instead of importing through the TB .csv import module). Is there an already made module or anything that could make my life simpler ? Is there an API of some sort ? Thanks.
  2. @MockoB said in Retina images! Please help!: @ssimard what about category banner images, blog thumbnails etc. ? Haven't gone that far yet, we are still building this site and are far from being done. But basically, if you had a 2x image built, you can fix your theme the same way for these I assume.
  3. Cool ! Thanks. It fixed a weird bug too while creating all the sizes. I had some that were smaller with white areas around them, like it was using a smaller version instead of the source. Wasn't too sure of why getbestpath was used instead of the original..
  4. My hack is not really pretty, I was testing yesterday and made it work quickly enough for my needs. Here's the full override of the function, I left artefacts because I was unsure about them, maybe you could have a look and do a proper fix ? ``` protected static function copyImg($idEntity, $idImage = null, $url = '', $entity = 'products', $regenerate = true) { $tmpfile = tempnam(PSTMPIMGDIR_, 'psimport'); $watermarkTypes = explode(',', Configuration::get('WATERMARKTYPES')); switch ($entity) { default: case 'products': $imageObj = new Image($idImage); $path = $imageObj->getPathForCreation(); break; case 'categories': $path = _PS_CAT_IMG_DIR_.(int) $idEntity; break; case 'manufacturers': $path = _PS_MANU_IMG_DIR_.(int) $idEntity; break; case 'suppliers': $path = _PS_SUPP_IMG_DIR_.(int) $idEntity; break; case 'stores': $path = _PS_STORE_IMG_DIR_.(int) $idEntity; break; } $url = urldecode(trim($url)); $parsedUrl = parse_url($url); if (isset($parsedUrl['path'])) { $uri = ltrim($parsedUrl['path'], '/'); $parts = explode('/', $uri); foreach ($parts as &$part) { $part = rawurlencode($part); } unset($part); $parsedUrl['path'] = '/'.implode('/', $parts); } if (isset($parsedUrl['query'])) { $queryParts = []; parse_str($parsedUrl['query'], $queryParts); $parsedUrl['query'] = http_build_query($queryParts); } $url = http_build_url('', $parsedUrl); $origTmpfile = $tmpfile; if (Tools::copy($url, $tmpfile)) { // Evaluate the memory required to resize the image: if it's too much, you can't resize it. if (!ImageManager::checkImageMemoryLimit($tmpfile)) { @unlink($tmpfile); return false; } $tgtWidth = $tgtHeight = 0; $srcWidth = $srcHeight = 0; $error = 0; ImageManager::resize($tmpfile, $path.'.jpg', null, null, 'jpg', false, $error, $tgtWidth, $tgtHeight, 5, $srcWidth, $srcHeight); $imagesTypes = ImageType::getImagesTypes($entity, true); $generateHiDpiImages = (bool) Configuration::get('PS_HIGHT_DPI'); if ($regenerate) { $previousPath = null; $pathInfos = []; $pathInfos[] = [$tgtWidth, $tgtHeight, $path.'.jpg']; foreach ($imagesTypes as $imageType) { //$tmpfile = static::get_best_path($imageType['width'], $imageType['height'], $pathInfos); if (ImageManager::resize( $path.'.jpg', $path.'-'.stripslashes($imageType['name']).'.jpg', $imageType['width'], $imageType['height'] ) ) { // the last image should not be added in the candidate list if it's bigger than the original image if ($tgtWidth <= $srcWidth && $tgtHeight <= $srcHeight) { $pathInfos[] = [$tgtWidth, $tgtHeight, $path.'-'.stripslashes($imageType['name']).'.jpg']; } if ($entity == 'products') { if (is_file(_PS_TMP_IMG_DIR_.'product_mini_'.(int) $idEntity.'.jpg')) { unlink(_PS_TMP_IMG_DIR_.'product_mini_'.(int) $idEntity.'.jpg'); } if (is_file(_PS_TMP_IMG_DIR_.'product_mini_'.(int) $idEntity.'_'.(int) Context::getContext()->shop->id.'.jpg')) { unlink(_PS_TMP_IMG_DIR_.'product_mini_'.(int) $idEntity.'_'.(int) Context::getContext()->shop->id.'.jpg'); } } } if ($generateHiDpiImages) { ImageManager::resize( $path.'.jpg', $path.'-'.stripslashes($imageType['name']).'2x.jpg', (int) $imageType['width'] * 2, (int) $imageType['height'] * 2); } if (in_array($imageType['id_image_type'], $watermarkTypes)) { Hook::exec('actionWatermark', ['id_image' => $idImage, 'id_product' => $idEntity]); } } } } else { @unlink($origTmpfile); return false; } unlink($origTmpfile); return true; } ```
  5. Oh and I should also mention that importing through the csv DOES NOT create the 2x retina images, it only works when adding a product via the backend. So I had to hack the copyImg() function in AdminImportController too...
  6. I know this is somehow a bit old but I've just upgraded my custom template to support retina images. Basically, all I had to do was to add the html5 "srcset" tag for 2x screens to all my images sources and it worked like a charm. Ex. <a class="product_img_link" href="{$product.link|escape:'html':'UTF-8'}" title="{$product.name|escape:'html':'UTF-8'}" itemprop="url"> <img class="replace-2x img-responsive center-block" src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'home_default')|escape:'html':'UTF-8'}" srcset="{$link->getImageLink($product.link_rewrite, $product.id_image, 'home_default2x')|escape:'html':'UTF-8'} 2x" alt="{if !empty($product.legend)}{$product.legend|escape:'html':'UTF-8'}{else}{$product.name|escape:'html':'UTF-8'}{/if}" title="{if !empty($product.legend)}{$product.legend|escape:'html':'UTF-8'}{else}{$product.name|escape:'html':'UTF-8'}{/if}" {if isset($homeSize)} width="{$homeSize.width}" height="{$homeSize.height}"{/if} itemprop="image" /> </a>
  7. No it's not there in my downloads indeed. Might be because I've mixed the paper and the ePub. Thanks for your time anyway, I think I will put this aside a bit for now, not looking very stable on my side and I have to remove all my own overwrites to install it.
  8. @Havouza said in No attributes for virtual products/services: Btw did you get your download? Just noticed the emails were in my spam folder.. Got the payment accepted email but not the file download one, only have the receipt.
  9. Yeah looks like it, and my shop is not on the same domain as my email address either.
  10. Says 'this domain belongs to another account', security is working ;-)
  11. @Havouza said in No attributes for virtual products/services: I used the email I used when I created the account with "seller" That's the one I am trying to use and it wont work. Tried registering with another and I got the same results hummmmm
  12. It's only my desktop dev installation no worries. I know why.. it is because I had some of the same files already in the override folder and it breaks it, can't install if files are there already. Renamed mine and I could install.. but now i cant log to update it, says this domain is already associated with another account :-/
  13. I've just tried to install it but it crashed at first then the second time I got this: Parse error: syntax error, unexpected '{', expecting function (T_FUNCTION) in /Applications/XAMPP/xamppfiles/htdocs/tbquebecamerique/classes/module/Module.php(1859) : eval()'d code on line 22 [PrestaShopException] Class ProductOverrideOriginal_remove593e9ebf16602 does not exist at line 1860 in file classes/module/Module.php
  14. Just got back at the office, you guys are working on weekends ? ;-) Please let me know what the dev says, i'm very anxious to give this a try :-) Thanks ! Great find !
  15. ssimard

    Paypal NVI

    I'm using it as a credit card processor and not as a standard Paypal payment...
  16. ssimard

    Paypal NVI

    You are right.. But I am using this one and it is working very well: PayPal Pro (Direct Payment + Hosted Solution) V1.4.3 At least it was working a few weeks ago when I've set it up, who knows if Paypal made changes again since then :-/ Paypal does not support REST in Canada so I had no choice.
  17. @Havouza Please link to it once it is done so I can go and vote for it.
  18. If I had to vote, this would be first on my wanted list, just saying ;-)
  19. One thing I've noticed is that you can’t have a standard product and add a downloadable file as an attribute in order for the buyer to choose between the physical product and the downloadable. At least I did not find a way to do it. I am selling books.. So having the physical book, pdf and ePub versions available as product variations would be great. I don't want to give the eBook away if they choose the physical version etc. Right now I hacked it using 3 distinct products. I will also be selling access to a premium website for 6 months, 1 and 3 years. Should all be in the same product as well as variations.
  20. Holy shit! You guys are on fire, I've got to unsubscribe from this thread, my Pebble is buzzing non-stop LOL Sorry for the hijack, please keep it up, I love how this software is moving on :-)
  21. @mdekker said in What is going with the Paypal module? EU, USA modules?: OT: would Braintree be a better alternative? I see they apply a very simple pricing scheme: NA: 2.9% + $.30 EU: 1.9% + €0.30 My goal is to build this new website and get it online asap. I will eventually check into alternatives if Paypal ever fails but as long as I can keep using it, I think I will. Once Paypal Payment Pro is added into the native module we should be fine here I assume. But I will definitely investigate on Braintree after that.
  22. Do they have to use PayPal's systems or are they just used to using PayPal? Just used to using it, they don't like change ;-) I wanted to go with our debit card processor (Moneris) at first but there is only one module for Prestashop and wanted to go with a more widespread technology (Paypal). Thinking about future support here, I don't want to write a full module all my myself..
  23. Important: Website Payments Pro has been replaced in the US and Canada by PayPal Payments Pro. >Website Payments Pro is still supported for new merchants in the UK and for previously integrated >merchants in the US and Canada. For PayPal Payments Pro integration information, see the PayPal >Payments Pro / Payflow documentation. I'm not sure what the difference is... they barely changed the name, it's hard to understand.
  24. Will have to check Braintree in details, never looked at it. My finance dept wanted to stay with Paypal since they are already used to it. I wanted to stay with them for simplicity.. but it is anything but simple these days, even Paypal docs are contradictory.
  25. @mdekker said in What is going with the Paypal module? EU, USA modules?: I see that Canadian Dollars can be accepted via the REST API. It would be strange not to connect Canadians with the REST API. I will dig it, I have read it somewhere in the docs.. they wont accept direct credit card payments using the REST API in Canada. Direct Credit Card Payments For direct credit card payments, PayPal accepts buyer credit cards issued in any country. However, the >merchant must have a Pro UK merchant account with PayPal to process PayPal REST API direct credit card >payments. This is the only supported merchant account for REST API direct credit card payments at this >time. UK Pro merchants can refer to supported currencies for details. I have read something more explicit.. will post back.
×
×
  • Create New...