Jump to content

LeeFoster

Members
  • Content count

    1,344
  • Joined

  • Last visited

  • Days Won

    10

Everything posted by LeeFoster

  1. LeeFoster

    Import / Export

    Anything that there is would probably not work with current versions. Would be a really useful add-on though.
  2. LeeFoster

    Attribute Images

    Morning All, I am looking for an add-on that allows the image to change based on the attribute selected. Needs to work with Phoenix or at least be recently new so it can be modified. Does anyone know of anything? Thanks
  3. Does it till need core code changes?
  4. LeeFoster

    Wishlist For Phoenix

    Did neither, I'll carry on looking though. The wishlist addon has its class file that contains it's own count_contents function.
  5. LeeFoster

    Wishlist For Phoenix

    Finally got this on a live site and now getting the below error on the first visit to the site. Any ideas? Or can I just suppress it?
  6. LeeFoster

    Wishlist For Phoenix

    Yeah that did it, thanks.
  7. LeeFoster

    Wishlist For Phoenix

    Still struggling to get this fully hooked. The final piece is just out of reach, the application_top.php change still isn't working. I have created the hook file however it doesn't seem to be passing the session data even though it is passing data to the database. Do any of the core dev's have 5 mins to help @ecartz @burt?
  8. LeeFoster

    Wishlist For Phoenix

    It's writing the data to the database as it should but it's not showing on the wishlist page.
  9. LeeFoster

    Wishlist For Phoenix

    I managed to hook in the application_bottom.php changes thanks to @burt adding some more hooks, however, it doesn't fully work. The page redirects to the wishlist as it should but nothing is added not. The code is below class hook_shop_system_wishlistApp { var $preActionApp = null; public function listen_preActionApp() { // BOF WISHLIST // wishlist data if (!tep_session_is_registered('wishList') || !is_object($wishList)) { tep_session_register('wishList'); $wishList = new wishlist; } //Wishlist actions (must be before shopping cart actions) if (isset($_POST['wishlist'])) { if (isset($_POST['products_id']) && is_numeric($_POST['products_id'])) { $attributes = isset($_POST['id']) ? $_POST['id'] : ''; // php 5 $qty = isset($_POST['qty']) ? (int)$_POST['qty'] : 1; // php 7 //$qty = (int)($_POST['qty'] ?? 1); $wishList->add_wishlist($_POST['products_id'], $wishList->get_quantity(tep_get_uprid($_POST['products_id'], $attributes))+$qty, $attributes); } if (WISHLIST_REDIRECT == 'No') tep_redirect(tep_href_link('product_info.php', 'products_id=' . $_POST['products_id'])); tep_redirect(tep_href_link('wishlist.php')); } // EOF WISHLIST } }
  10. LeeFoster

    Attribute Images

    I have this code working as a hook but if the image is not there it shows the missing image icon. Once I get that sorted I'm happy. <script> $(function() { $("#input_1").change(function(){ var selectedImage = $(this).find(':selected').val(); val = $("#input_1 option:selected").text(); $("a.lb:first").html( "<img src=images/"+ {$prod_id} + "_" + selectedImage + ".jpg>"); $('a.lb:first img').addClass( "img-fluid" ); }); }); </script>
  11. LeeFoster

    Attribute Images

    When put inside my existing hook this doesn't work for me. That said you did say you had it hard coded.
  12. LeeFoster

    Attribute Images

    And this uses the image naming convention of ProductId_optionID?
  13. LeeFoster

    Attribute Images

    How did you get around this?
  14. LeeFoster

    Attribute Images

    My current range of products only have one attribute, I'll address multiple attributes when it comes up unless @burt has an idea?
  15. LeeFoster

    Attribute Images

    Yes it does need there to be an image for all options.
  16. LeeFoster

    Attribute Images

    The images are named after the product id combined with the option id and added in the same way as a normal image. So you see them like this -
  17. LeeFoster

    Attribute Images

    Couldn't get it to work as a hook, rather than wait for someone else to come up with a solution I decided to take a different approach and create it as a header tag module and now I have a working image change function. And then I realise the reason the hook isn't working is because notepad++ isn't saving the file as .php and I have it working as a hook.
  18. LeeFoster

    Attribute Images

    Tried this and still not working. I used the showPassword hook as my basis and that that doesn't declare any globals so don't see why this would need to. The hook doesn't seem to be getting called though.
  19. LeeFoster

    Attribute Images

    Nope, this didn't make a difference.
  20. LeeFoster

    Attribute Images

    This is the hook I got to but it doesn't appear to work. class hook_shop_siteWide_changeImage { var $site_end = null; var $safe_pages = ['product_info.php']; function listen_injectSiteEnd() { $changeImageScript = <<<eod <script> $(function() { var img_option = "<?php echo $_GET['products_id']; ?>"; $("#input_1").change(function(){ var selectedImage = $(this).find(':selected').val(); val = $("#input_1 option:selected").text(); $("a.lb:first").html( "<img src=images/"+ img_option + "_" + selectedImage + ".jpg>"); $('a.lb:first img').addClass( "img-fluid" ); }); }); </script> eod; if (in_array(basename($_SERVER['PHP_SELF']), $this->safe_pages)) { $this->site_end .= '<!-- changeImage hooked -->' . PHP_EOL; $this->site_end .= $changeImageScript . PHP_EOL; return $this->site_end; } }
  21. LeeFoster

    Attribute Images

    Yeah that's my preference but where to hook? Or do we need a new one?
  22. LeeFoster

    Attribute Images

    Is this hard coded or hooked?
  23. LeeFoster

    Attribute Images

    I just added the class, lol <script> $(function() { var img_option = "<?php echo $_GET['products_id']; ?>"; $("#input_1").change(function(){ var selectedImage = $(this).find(':selected').val(); val = $("#input_1 option:selected").text(); $("a.lb:first").html( "<img src=images/"+ img_option + "_" + selectedImage + ".jpg class='img-fluid'>"); }); }); </script>
  24. LeeFoster

    Attribute Images

    Says video unavailable
  25. LeeFoster

    Attribute Images

    Was just highlighting the difference between someone with experience like you and the copy and paste coders like us.
×