Jump to content

rofli123

Members
  • Posts

    25
  • Joined

  • Last visited

Profile Information

  • First Name
    rofli
  • Last Name
    tos

rofli123's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. These errors keep appearing when I save any product new or old. I have to press "Save" 20 times until the errors don't appear anymore and the Product gets saved. Prestashop version is 1.6.1.5 Any help is very much appreciated. Thanks
  2. On homepage when you mouseover a product it appears small box below with Add to cart and See more. When screen width is <= 1099 the small box is always displayed. How to make it hidden and shown only on mouseover on width <= 1099 ? (So make it like it is on screenwidth > 1099) I've checked media queries on css but haven't found the fix. Any help is very apreciated.
  3. Hi. var example = '{$cms->id}' works if script source is within .tpl file. If you link external script then you can't use smarty variables on it like that. Or can you? Is it possible to access smarty variables from script source outside of .tpl file? Regards
  4. PS 1.6.1.5 I have created /themes/theme_name/modules/homeslider/css/homeslider.css Override is however not taking place. I've seen older version where you must copy .png images, I have done so, however it didn't fix it. Any help is appreciated. Thank you!
  5. For some reason triggering it like this $("#view_scroll_left").trigger("click"); wouldn't work, however changing the serialScroll function worked. Thank you NemoPS!
  6. Hi, Under product pic there is #thumbs_list with all product image thumbnail. There is also #view_scroll_right and left button that slide thumbs when clicked. I want another button I have added to do the same but I don't know how. I have looked at product.js but it's very confusing. There is only: function serialScrollFixLock(event, targeted, scrolled, items, position) { var serialScrollNbImages = $('#thumbs_list li:visible').length; var leftArrow = position == 0 ? true : false; var rightArrow = position + serialScrollNbImagesDisplayed >= serialScrollNbImages ? true : false; $('#view_scroll_left').css('cursor', leftArrow ? 'default' : 'pointer').css('display', leftArrow ? 'none' : 'block').fadeTo(0, leftArrow ? 0 : 1); $('#view_scroll_right').css('cursor', rightArrow ? 'default' : 'pointer').fadeTo(0, rightArrow ? 0 : 1).css('display', rightArrow ? 'none' : 'block'); return true; } and $('#thumbs_list').serialScroll({ items:'li:visible', prev:'#view_scroll_left', next:'#view_scroll_right', axis:'x', offset:0, start:0, stop:true, onBefore:serialScrollFixLock, duration:700, lazy: true, lock: false, force:false, cycle:false }); Very confusing. What function slides the thumbs? so that I can easily: $('#mybutton').click(function(){ SlideThumbs(); }); How could this be done easily? Thanks!
  7. Excellent, it works! Thank you! Don't worry about the misunderstanding, I learnt about Classes and some php :-) Cheers
  8. Hey razaro, thank you for the links. I have read and followed the tutorial but still can't get it to work. I hope you or somebody else can help me. I've done this: \override\classes\Product.php <?php Class Product extends ProductCore { public function getAdjacentPictures() { $product_id = $_GET['id_product']; $pics = array(); $sql= 'SELECT id_image FROM ' ._DB_PREFIX_.'image WHERE id_product = '.$product_id.';'; $k = Db::getInstance(_PS_USE_SQL_SLAVE_)->NumRows($sql); for ($i=1;$i<=$k;$i++) { $sql2= 'SELECT id_image FROM ' ._DB_PREFIX_.'image WHERE id_product = '.$product_id. ' AND position = '.$i.';'; $pics["$i"] = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql2); } return $pics; } } ?> \override\controllers\front\ProductController.php <?php Class ProductController extends ProductControllerCore { public function initContent() { $pics = $this->product->getAdjacentPictures(); $k = count($pics); $this->context->smarty->assign('productarray', array( 'productPic1' => $pics[1] )); for ($i=2; $i<=$k; $i++){ $temp_array = array( "productPic$i" => $pics["$i"] ); $this->context->smarty->append('productarray', $temp_array, true); unset($temp_array); } parent::initContent(); } } ?> Yet after deleting cache and so on, $productPic1 is empty from product page. Errors on product page although not sure relevant: tice: Trying to get property of non-object in C:\xampp\htdocs\tools\smarty\sysplugins\smarty_internal_templatebase.php(157) : eval()'d code on line 484 Notice: Undefined index: productPic1 in C:\xampp\htdocs\tools\smarty\sysplugins\smarty_internal_templatebase.php(157) : eval()'d code on line 163 Notice: Trying to get property of non-object in C:\xampp\htdocs\tools\smarty\sysplugins\smarty_internal_templatebase.php(157) : eval()'d code on line 163 Again any help is pretty much apreciated :-) Regards
  9. Thank you yaniv14 for your reply! I didn't know about Debug mode :-) It works now. Cheers
  10. My product page doesn't load anymore after overriding Product class like this: <?php Class Product extends ProductCore { public function getAdjacentPictures($product_id) { $sql= "SELECT id_image FROM `"._DB_PREFIX_."image` WHERE `id_product` = $product_id"; $sql_q = Db::getInstance()->getRow($sql); k = mysqli_num_rows($sql_q); for (i=1;i<k;i++ { $sql2= "SELECT id_image FROM `"._DB_PREFIX_."image` WHERE `id_product` = $product_id AND position = $i"; $pics['$i'] = Db::getInstance()->getRow($sql2); } return $pics; } } ?> Any idea? I want to get all image_id from a single product in order to let a Jquery script change them when some buttons are clicked. Thank you for your help!
  11. I have noticed that in Jquery for example, var id_product='{$product->id|intval}';works. How can I however do something like $i = 1; image[$i] = "{$pics[$i]}" How can i use $i to call smarty var? ??
  12. I know how the image urls are based of image-id and those are in the DB. I know in theory how to do it but practically I am lost. It would be easy for me to make it with js/jquery but the problem is making the sql queries. I can't / don't want to do it from js for security reasons. My idea is: Two buttons on top of the product image. When button is clicked, position parameter (which is the same on db.image) +=1, request new image id from db where position = position+1; construct new link with image_id, with Jquery update attr of Image ("src", newlink) and it is done. My problem is integrating the sql query with my JQuery code. How should this be done properly? I am new to programming so any help is very appreciated.
×
×
  • Create New...