Jump to content

Dallerdkj

Members
  • Posts

    85
  • Joined

  • Last visited

Profile Information

  • Location
    Denmark
  • Interests
    Webdesign and E-shopping is my passion
  • Activity
    Other

Recent Profile Visitors

4,724,457 profile views

Dallerdkj's Achievements

Newbie

Newbie (1/14)

5

Reputation

1

Community Answers

  1. I'm having this trouble figuring out, what i need to change in order to accomplish this. First of all, im using media servers because my web host don't have enough space. So what i want is, when i delete product from webhost (server 1, where website and db is located) i also need to delete the images from mediaserver (server 2, where only product images are stored). Could be a really nice feature, if media servers is set. This way, old images from products won't take up space when deleted. At this moment, everytime i delete a product, it throws an error Where do i need to edit the prestashop code? I really hope someone can help me out :-) PS. 1.6.0.6
  2. Hello everyone. I searched and couldnt find anyway in my PS system, where i can hide categories that are empty. Maybe im just missing something, because I think its vital in the block categories. Anyways, can someone help me out on this. Basically I want to hide all categories, that are empty. Also categories where products are deactivated. Prestashop v. 1.6.0.6 Any free modules maybe? Thanks guys! :-)
  3. Hello guys Just wanna share how i managed to solve the "Connection was reset" error. This was happening randomly on my site, when i logged out (didnt work), updating translations, etc. When i enabled debug, it didnt show anything, my apache logs was empty, so it was a huge bug without a trace. Solved by setting my memory_limit a little lower, e.g, from 2048M to 1024M in my PHP.ini My VPS has 4GB memory, so the 2048M that crashed my site randomly, wasnt even close to use it all. Hope it will help somebody out there.
  4. I found a solution if anyone else needs to customize a 1.5 module - However it still does not show the "added to cart" popup on product page. As I can see, the 1.6 uses forms to do the add to cart function. <form action="{$link->getPageLink('cart')|escape:'html':'UTF-8'}?qty=1&id_product={$accessory.id_product|intval}&token={$static_token}&add" method="POST"> <input type="submit" class="button_small exclusive_small" value="{l s='Add' mod='productaccessories'}" /> </form> Now does anyone know how to invoke the popup page?
  5. Hello I have a productaccessories module, that i just finished styling and then i realise that Add to cart dont work So my question is, what is the correct way to make it add product to cart. My products add to cart is js, so no URL to see (a simple html button). The Add to cart code looks like this: <a class="button_small exclusive_small ajax_add_to_cart_button" href="{$base_dir}cart.php?qty=1&id_product={$accessory.id_product|intval}&token={$static_token}&add" rel="ajax_id_product_{$accessory.id_product|intval}" title="{l s='Add to cart' mod='productaccessories'}">{l s='Add' mod='productaccessories'}</a> But this is not the correct way in PS 1.6?
  6. Hello everyone I have testet a zoom crop script in order to keep my images on my site structured (with same dimensions) and because of the automatic white background i needed somehow to generate full thumbs (sites background is also white) So I found this topic about a script and testet: http://www.prestashop.com/forums/topic/202945-automatic-images-cropping-for-prestashop-152-free-override/ Now my only problem is, it is cropping from the middle position. I need to crop from the upper left corner and down. This is the code I have placed in overrides/classes: <?php // Usage: // Replace the contents of: // /overrides/classes/ImageManager.php // With this document. Then just add a new image size in the Backoffice : // Preferences -> Images -> Add New // AND name it whatever_btt (attach '_btt' at the end of the name string) // THEN just use this image size where you want // CAUTION! Check if you're using the same version of Prestashop as we do: 1.5.2 // (should work in all 1.5.xs though but we never checked // Good luck - Bazinga Designs // http://www.bazingadesigns.com/en class ImageManager extends ImageManagerCore { /** * Resize, cut and optimize image * * Zoom & Croop when the destination file name * contains the '_timthumb' phrase * - Modified by www.bazingadesigns.com/en * (TimThumb ZoomCrop port) * * @param string $src_file Image object from $_FILE * @param string $dst_file Destination filename * @param integer $dst_width Desired width (optional) * @param integer $dst_height Desired height (optional) * @param string $file_type * @return boolean Operation result */ public static function resize($src_file, $dst_file, $dst_width = null, $dst_height = null, $file_type = 'jpg', $force_type = false) { if (!file_exists($src_file)) return false; list($src_width, $src_height, $type) = getimagesize($src_file); // If PS_IMAGE_QUALITY is activated, the generated image will be a PNG with .jpg as a file extension. // This allow for higher quality and for transparency. JPG source files will also benefit from a higher quality // because JPG reencoding by GD, even with max quality setting, degrades the image. if (Configuration::get('PS_IMAGE_QUALITY') == 'png_all' || (Configuration::get('PS_IMAGE_QUALITY') == 'png' && $type == IMAGETYPE_PNG) && !$force_type) $file_type = 'png'; if (strpos($dst_file, '_btt')!==FALSE) $zoomCrop = true; else $zoomCrop = false; if (!$src_width) return false; if ($zoomCrop == true) { if (!$dst_width) $dst_width = 0; if (!$dst_height) $dst_height = 0; } else { if (!$dst_width) $dst_width = $src_width; if (!$dst_height) $dst_height = $src_height; } $src_image = ImageManager::create($type, $src_file); $width_diff = $dst_width / $src_width; $height_diff = $dst_height / $src_height; if ($zoomCrop==true) { if ($dst_width>0 && $dst_height<1) { $dst_height = floor ($src_height * ($dst_width / $src_width)); } else if ($dst_height>0 && $dst_width<1) { $dst_width = floor ($src_width * ($dst_height / $src_height)); } $src_x = $src_y = 0; $src_w = $src_width; $src_h = $src_height; $cmp_x = $src_width / $dst_width; $cmp_y = $src_height / $dst_height; if ($cmp_x > $cmp_y) { $src_w = round (($src_width / $cmp_x * $cmp_y)); $src_x = round (($src_width - ($src_width / $cmp_x * $cmp_y)) / 2); } else if ($cmp_y > $cmp_x) { $src_h = round (($src_height / $cmp_y * $cmp_x)); $src_y = round (($src_height - ($src_height / $cmp_y * $cmp_x)) / 2); } } else if ($width_diff > 1 && $height_diff > 1) { $next_width = $src_width; $next_height = $src_height; } else { if (Configuration::get('PS_IMAGE_GENERATION_METHOD') == 2 || (!Configuration::get('PS_IMAGE_GENERATION_METHOD') && $width_diff > $height_diff)) { $next_height = $dst_height; $next_width = round(($src_width * $next_height) / $src_height); $dst_width = (int)(!Configuration::get('PS_IMAGE_GENERATION_METHOD') ? $dst_width : $next_width); } else { $next_width = $dst_width; $next_height = round($src_height * $dst_width / $src_width); $dst_height = (int)(!Configuration::get('PS_IMAGE_GENERATION_METHOD') ? $dst_height : $next_height); } } $dest_image = imagecreatetruecolor($dst_width, $dst_height); // If image is a PNG and the output is PNG, fill with transparency. Else fill with white background. if ($file_type == 'png' && $type == IMAGETYPE_PNG) { imagealphablending($dest_image, false); imagesavealpha($dest_image, true); $transparent = imagecolorallocatealpha($dest_image, 255, 255, 255, 127); imagefilledrectangle($dest_image, 0, 0, $dst_width, $dst_height, $transparent); } else { $white = imagecolorallocate($dest_image, 255, 255, 255); imagefilledrectangle ($dest_image, 0, 0, $dst_width, $dst_height, $white); } if ($zoomCrop==true) imagecopyresampled($dest_image, $src_image, 0, 0, $src_x, $src_y, $dst_width, $dst_height, $src_w, $src_h); else imagecopyresampled($dest_image, $src_image, (int)(($dst_width - $next_width) / 2), (int)(($dst_height - $next_height) / 2), 0, 0, $next_width, $next_height, $src_width, $src_height); return (ImageManager::write($file_type, $dest_image, $dst_file)); } } Hope someone out there can see where the script needs to be changed Thanks
  7. Hello I need a module that is able to let the client choose to pay total order over several month, e.g. choose to pay over 1, 3, 6 month. Where can i find this? Cant find any paid modules Thanks
  8. Perfect Thank you for your tip! I must say that the layout on the screenshot is beautiful. Looking forward to try it in the future
  9. Its working perfect! Thank you for your great help Vekia. What would this forum do without you - I have read alot of topics where you help us out, and i must say im a Big fan :-) One more question, im still on the 1.5.6 - Is the screenshot a stable 1.6? And can you mark this as solved? Have a great weekend! Daniel
  10. Thanks Vekia! Will this enable me to show the discount name, let's say the discount name is "Joe". Will this enable me to show the discount name? I've tried to print array, and cant seem to find anything. Hmm. Im pasting my code: Thanks Edit: Im modifying it with the full code -> class AdminOrdersControllerCore extends AdminController { public $toolbar_title; public function __construct() { $this->table = 'order'; $this->className = 'Order'; $this->lang = false; $this->addRowAction('view'); $this->explicitSelect = true; $this->allow_export = true; $this->deleted = false; $this->context = Context::getContext(); $this->_select = ' ocr.*, a.id_currency, a.id_currency, a.id_order AS id_pdf, CONCAT(LEFT(c.`firstname`, 1), \'. \', c.`lastname`) AS `customer`, osl.`name` AS `osname`, os.`color`, IF((SELECT COUNT(so.id_order) FROM `'._DB_PREFIX_.'orders` so WHERE so.id_customer = a.id_customer) > 1, 0, 1) as new'; $this->_join = ' LEFT JOIN `'._DB_PREFIX_.'order_cart_rule` ocr ON (ocr.`id_order` = a.`id_order`); LEFT JOIN `'._DB_PREFIX_.'customer` c ON (c.`id_customer` = a.`id_customer`) LEFT JOIN `'._DB_PREFIX_.'order_state` os ON (os.`id_order_state` = a.`current_state`) LEFT JOIN `'._DB_PREFIX_.'order_state_lang` osl ON (os.`id_order_state` = osl.`id_order_state` AND osl.`id_lang` = '.(int)$this->context->language->id.')'; $this->_orderBy = 'id_order'; $this->_orderWay = 'DESC'; $statuses_array = array(); $statuses = OrderState::getOrderStates((int)$this->context->language->id); foreach ($statuses as $status) $statuses_array[$status['id_order_state']] = $status['name']; print_r($this); $this->fields_list = array( 'name-of-discount' => array( 'title' => $this->l('name-of-discount'), 'align' => 'center', 'width' => 25 ),
  11. Hello everyone. I need some help with this SQL code, so i also can show the name of the discount used - This is important, because it's used for tracking purposes. I have this code: public function __construct() { $this->table = 'order'; $this->className = 'Order'; $this->lang = false; $this->addRowAction('view'); $this->explicitSelect = true; $this->deleted = false; $this->context = Context::getContext(); $this->_select = ' a.id_currency, a.id_order AS id_pdf, CONCAT(LEFT(c.`firstname`, 1), \'. \', c.`lastname`) AS `customer`, osl.`name` AS `osname`, os.`color`, IF((SELECT COUNT(so.id_order) FROM `'._DB_PREFIX_.'orders` so WHERE so.id_customer = a.id_customer) > 1, 0, 1) as new'; $this->_join = ' LEFT JOIN `'._DB_PREFIX_.'customer` c ON (c.`id_customer` = a.`id_customer`) LEFT JOIN `'._DB_PREFIX_.'order_state` os ON (os.`id_order_state` = a.`current_state`) LEFT JOIN `'._DB_PREFIX_.'order_state_lang` osl ON (os.`id_order_state` = osl.`id_order_state` AND osl.`id_lang` = '.(int)$this->context->language->id.')'; $this->_orderBy = 'id_order'; $this->_orderWay = 'DESC'; $statuses_array = array(); $statuses = OrderState::getOrderStates((int)$this->context->language->id); foreach ($statuses as $status) $statuses_array[$status['id_order_state']] = $status['name']; $this->fields_list = array( 'total_discounts' => array( 'title' => $this->l('Discounts'), 'align' => 'center', 'width' => 25 ), The code above, shows the total discount the customer had. This is where the problem begins. I can't figure out, how to modify the SQL statement, so i can display discount name. I know the discount code, and id_customer is located in _cart_rules, and row "code" in my MYSQL Db. Can anyone please help me achieve this goal. Thanks guys :-)
  12. I have the exact same problem! What's even more weird is that if im inserting the correct URL (category URL in the choosen category) after i press back, et redirects to base. Its a bit tricky to explain. But every time i press Back from a product, it redirects me to Productcategoryname instead of productcategoryname->ipodcategoryname. I really hope there will be a solution because the blocklayered module are one of the best things about PS
  13. Great Video! Thanks for posting. And what a great design. Seems like a total change of BO since the early PS releases.
×
×
  • Create New...