Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by catalin.pop

  1. Hello. From what I understand you want to change the ' Shipping charge ' text with "Service charge" text in your website template, so your clients can see Service charge but on back end everything is computed as shipping charge. Am I right?
  2. Since you've changed the forum look, I saw that the number of posts I have on this forum decreased. Did you deleted some threads?
  3. For quoted text in posts font size is set to 26px and looks extremely big and I have an 1080p display. I can only imagine how this will show on smaller resolutions screens. I think you should decrease the size to 16px
  4. Google can be your friend: https://belvg.com/blog/prestashop-1-7-mvc-part-2-creating-a-controller.html class mymoduleMycontrollerModuleFrontController extends ModuleFrontController { public function initContent() { parent::initContent(); $this->context->smarty->assign(array( 'hello' => 'Hello World!!!', )); $this->setTemplate('template_name.tpl'); } }
  5. <?php $context=Context::getContext();//new Cart(); $id_cart=$context->cookie->__get('id_cart'); $products_ids=$_GET['products_ids']; // comma seprated products id example : test.php?products_ids=1,2,3 $products_ids_array=explode(",",$products_ids); if(count($products_ids_array)>0){ $cart=new Cart($id_cart); $cart->id_currency=2; $cart->id_lang=1; foreach($products_ids_array as $key=>$id_product){ $cart->updateQty(1, $id_product); } } ?>
  6. Update Every time a client or an operator starts writing a message the other person is instantly notified. Read more on https://www.hubtalk.com/blog/2017/10/29/is-typing-app/
  7. The possibilities are endless. Have you tried looking at log files and see what's generating the 500 error? Also have you tried to update your PS to v1.6.1.17 the latest 1.6 version? Another solution is to do a clean install on a separate folder and see if the error persists. Maybe it's from your php configuration, maybe it's a module
  8. I'm not sure if this is the best idea but I'll save values using // save(update) value Configuration::updateValue('my_module_something', 'some value'); // get value Configuration::get('my_module_something'); // returns 'some value' In your case for let's say order: #ASDFGS I will save the value in json format like { "param1":"zxcv", "param2":"qwer" } then read it from admin panel // my_module = your module name // ASDFGS = order reference id Configuration::get('my_module_ASDFGS');
  9. Hello. I'm not sure if this is the answer you're looking for but I use to get product images on different sizes like this (though I'm not using them for pdf invoice) $productID = 123; // your product id $product = new Product($productID); $cover=Product::getCover($productID); if($cover["id_image"]){ $link_rewrite=is_array($product->link_rewrite)?$product->link_rewrite[1]:$product->link_rewrite; $link=new Link(); $image_link=Tools::getShopProtocol().$link->getImageLink($link_rewrite, $cover["id_image"], 'small_default'); } 'small_default' is the size of the thumbnail and you can change that size from admin http://doc.prestashop.com/display/PS17/Image+Settings By default there are many sizes that comes with prestashop: small_default, medium_default, you can built your own size like 'my_size' and make it 100x100px, then you'll replace 'small_default' parameter from the code above with 'my_size' .
  10. That would be the most clean way. If you don't want see my first answer. Just call the API from AdminProductsController It's up to you how you want to implement this.
  11. Oh..Ok. I think what you're looking for is Hooks http://doc.prestashop.com/display/PS17/Hooks+in+PrestaShop+1.7.x Especially those that start with action In your case you need to implement this methods in your module actionProductAdd - This hook is displayed after a product is created actionProductUpdate - This hook is displayed after a product has been updated See the link I provided for a complete hooks list.
  12. Like I said in post #6 from this thread https://www.prestashop.com/forums/topic/629309-attachments-on-email/?p=2615392 you should find all answers in prestashop_files/classes/order In Order.php you have the method setInvoice // Update order payment if ($use_existing_payment) { $id_order_payments = Db::getInstance()->executeS(' SELECT DISTINCT op.id_order_payment FROM `'._DB_PREFIX_.'order_payment` op INNER JOIN `'._DB_PREFIX_.'orders` o ON (o.reference = op.order_reference) LEFT JOIN `'._DB_PREFIX_.'order_invoice_payment` oip ON (oip.id_order_payment = op.id_order_payment) WHERE (oip.id_order != '.(int)$order_invoice->id_order.' OR oip.id_order IS NULL) AND o.id_order = '.(int)$order_invoice->id_order); if (count($id_order_payments)) { foreach ($id_order_payments as $order_payment) { Db::getInstance()->execute(' INSERT INTO `'._DB_PREFIX_.'order_invoice_payment` SET `id_order_invoice` = '.(int)$order_invoice->id.', `id_order_payment` = '.(int)$order_payment['id_order_payment'].', `id_order` = '.(int)$order_invoice->id_order); } // Clear cache Cache::clean('order_invoice_paid_*'); }
  13. From what I see there are no events attached to up/down arrows Here is from your jsfiddle: Here is from your website As you can see there are no events attached to those elements. And based on your page content is logic to happens like this. You've added the js code in your header (<head></head>) which is rendered first, then the <body> content where your elements are. With other others you want to apply js code to elements that are not yet created. What you need to do is bundle your code in a $( document ).ready which is called like this $( document ).ready(function() { // put your code here }); https://api.jquery.com/ready/
  14. So basically your problem is an SQL one. Have you tried printing the query , then running in pmpmyadmin for example see what returns? echo('SELECT address1 FROM `'._DB_PREFIX_.'address` WHERE `id_customer` = '.(int)$order->id_customer. ' ORDER BY id_address desc');
  15. The warnings come from Pack::getItems($buyId, $cookie->id_lang); Make sure $buyId is string or integer. try to print it before getting items see what is the result {foreach from=$buytogetherId item=buyId} {$buyId}
  16. Like I said, based on what you asked the only changes need to be done are in theme.css file
  17. There are a few modules that allow customers to upload images( do a google search ). I'm not sure if they offer cam capture feature, but you could implement it yourself using https://github.com/jhuckaby/webcamjs or similar libraries.
  18. Hello. Prestashop 1.7 is partially using twig template instead of smarty for admin. What you're looking for is prestashop_files/src/PrestaShopBundle/Resources/views/Admin/Product/catalog.html.twig See other .twig files in the folder
  19. Hello. First, can you paste your link one more time. I think the one you provided is broken. Second you should check your browser console for errors: ctrl+shift+k for Firefox or ctrl+shift+j for Chrome https://developers.google.com/web/tools/chrome-devtools/console/
  20. Templates are rendered by Smarty Best way is to look in Controller.php (prestashop/classes/controller) at smartyOutputContent /** * Renders controller templates and generates page content * * @param array|string $content Template file(s) to be rendered * @throws Exception * @throws SmartyException */ protected function smartyOutputContent($content) { $this->context->cookie->write(); $html = ''; . . . echo $html; // I think this is the html var you're looking for }
  21. OK. The method I provided changes the protocol for internal links. It doesn't help you with links to other websites. The clean way to do that is to take every template file and change it manually. The more messy and ugly way is to embed a javascript file that will automatically strip http from all urls. For example for images function stripHttp(string:String, stripWWW:Boolean = false):String { var s:String = string; var regexp:RegExp = new RegExp(!stripWWW ? "https*:\/\/" : "https*:\/\/(www\.)*", "ig"); return s.replace(regexp, ""); } $(window).ready(function(){ $('img').each(function(){ var img = $(this); var srcOld = img.attr('src'); var srcNew = stripHttp(srcOld); img.attr('src', srcNew); // Updating src here }); }); You can change the stripHttp method if you want a different result. In that example it transforms http://example.com into example.com
  22. $product = new Product(....) $product->getCategories(); or // getProductCategories return an array of categories which this product belongs to Product::getProductCategories($product_id); It's up to you how you want to display that array in product-list
  • Create New...

Important Information

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