Announcement

Collapse
No announcement yet.

use a php generated image for thumbnail image in the checkout?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    use a php generated image for thumbnail image in the checkout?

    Hi Guys,
    I'm working on a site at the moment which has thumbnail images in the checkout.

    All fine as I am just using <img src="<actinic:variable name="Thumbnail" />" /> to get the image from whatever has been selected in the thumbnail field in the product details|general area.

    However, what I would like to to is to either not use the Thumbnail variable at all, or use it if I can set it up to automatically select an image for the thumbnail from one generated by php script. (standard script that dynamically creates an image from the main product image and adds a prefix to the productimagefilename.)

    Any idea how this can be done or has anyone done it before?

    Regards
    Lee
    Boxhedge New Media Design
    Design and development solutions for SME's.
    Tel: 0118 966 2786
    Examples of work can be found at http://www.boxhedge.com

    #2
    I don't think that ProductImageFilename is available in the Cart Perl scripts. Only the Thumbnail image. You could investigate changing your code that generates your custom thumbnails to product a filename t_<productID>.jpg as you can get at the productID in the checkout.
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    Comment


      #3
      Cheers Norman that is useful information.

      I'll have a play and then post if i come up with anything
      cheers
      Lee
      Boxhedge New Media Design
      Design and development solutions for SME's.
      Tel: 0118 966 2786
      Examples of work can be found at http://www.boxhedge.com

      Comment


        #4
        Is there a reason why you can't or don't want to use the thumbnail image for this?
        If the thumbnail is used for something else then perhaps that part of the design code can be changed to use a product variable instead.

        Comment


          #5
          It's really just an ease of use thing for my client. They want to be able to just add a single product image then get any other image of the same product created for them using php.

          I have used Norman's logic and we are nearly there the only problem seems to be that to generate the images without it getting "stuck" I have had to use the old ProductID variable but the cart only picks up ProdRef.

          If I use ProdRef in the script generating the images... I bellieve it doesn't generate all images as ProdRef sometimes includes non numeric/alphabetic characters like {} I could be wrong

          Someone else might know away around this problem.

          Any thoughts?
          Lee
          Boxhedge New Media Design
          Design and development solutions for SME's.
          Tel: 0118 966 2786
          Examples of work can be found at http://www.boxhedge.com

          Comment


            #6
            How about some client side php to create the thumbnails from the main image instead.

            Comment


              #7
              I guess they could but I really want to keep it within actinic.
              Does anyone no why the ProdRef sometimes includes {}?

              Also, if the actual prod ref is manually added rather than actinc generating them would that stop this problem providing the client used numbers and alphabetic characters only.

              regards
              Lee
              Boxhedge New Media Design
              Design and development solutions for SME's.
              Tel: 0118 966 2786
              Examples of work can be found at http://www.boxhedge.com

              Comment


                #8
                The product ref can include spaces which will kill the script - the producID is a plain jane identifier against each product to be used in the cart scripts etc - so you may need a bit of fudging to get a one image suits all filename that can be found again.


                Bikster
                SellerDeck Designs and Responsive Themes

                Comment


                  #9
                  At least I am not going mad.

                  Is there a way of getting the script to not be broken by the spaces? another line of php?

                  or would the suggestion of inputting your own product reference stop teh creation of spaces or make is worse?
                  Boxhedge New Media Design
                  Design and development solutions for SME's.
                  Tel: 0118 966 2786
                  Examples of work can be found at http://www.boxhedge.com

                  Comment


                    #10
                    Do the {} actually get passed through or is it the Actinic preview adding these in?

                    You can not strip too much out as you need to get the correct file to be picked up in the cart which will prove tricky.


                    Bikster
                    SellerDeck Designs and Responsive Themes

                    Comment


                      #11
                      The {withprodidinbetween} happened with my first attempt using prodref variable.

                      They appeared in the image name for one thumbnail that was generated but no others were created.

                      When I switched to productid in the script all the image were created for every product but of course I couldn't use productID in the cart.

                      It's a pickle, more thoughts appreciated

                      Regards
                      lee
                      Boxhedge New Media Design
                      Design and development solutions for SME's.
                      Tel: 0118 966 2786
                      Examples of work can be found at http://www.boxhedge.com

                      Comment


                        #12
                        If anyone has any further thoughts on this I'd appreciate it.

                        I think the only way is to allow the php script to parse spaces into the image name if they exist. However i don't know if this is possible nor do i have the knowledge to work it out.

                        If anyone can think of a solution, I would be appreciative as always,

                        Regards
                        Lee
                        Boxhedge New Media Design
                        Design and development solutions for SME's.
                        Tel: 0118 966 2786
                        Examples of work can be found at http://www.boxhedge.com

                        Comment


                          #13
                          Going back though to my thought earlier about running some local php in Actinic. Can't you write some php within Actinic to automatically create a small image from the main image and then save it as the thumbnail if (not existing)? Much in the same way that Norman does with his Lightbox add-in.

                          Comment


                            #14
                            Thanks for the continuning help, keep it coming.

                            then save it as the thumbnail if (not existing)
                            I am doing this apart from the "save it as the thumbnail if (not existing)" as I am not sure how to effect this.

                            it's fine to write on a page "if thumbnail doesn't exist add this" but you can't do that in the cart.

                            I don't know how you would get the thumbnail variable to pick up the dynamic image ouside of a page template, which is effectively what you would have to do to then get it working in the cart. Maybe somone else does?

                            Unless i am missing something....which is normally the case,

                            Regards
                            lee
                            Boxhedge New Media Design
                            Design and development solutions for SME's.
                            Tel: 0118 966 2786
                            Examples of work can be found at http://www.boxhedge.com

                            Comment


                              #15
                              I was thinking of leaving the cart entirely alone. But - thinking more the problem is, as you mentioned, how to save to the thumbnail - mmm - certainly a problem I hadn't thought through fully.

                              This might be more hassle than it's worth - I'd take the easy way out and educate the client on how to create a thumbnail image initially when entering the products.

                              Comment

                              Working...
                              X