Author Topic: Optional URL image path set by VM = Problem...  (Read 7369 times)

akerman

  • Jr. Member
  • **
  • Posts: 325
  • Knowledge weighs Nothing!
    • STOLT/AKERMAN
Optional URL image path set by VM = Problem...
« on: May 03, 2008, 10:00:51 am »

I use a staging site where I implement new products, images or any type of system changes, before transferring the new content or changes to the production site.

Anyhow, this creates a problem in VM in regards of the 'Additional' product images.

When adding Additional images to a product there is an option to set full URL to the picture. I leave this blank.

VM fills the URL path by itself, after save.
This address equals the testsite - which forces me to manually change this entry on the production site. Picture by picture...

See attached image.


Having hundreds of products, this procedure won't work.

Is there a better way to do this or is this a flaw in VM?

Regards
Akerman 

[attachment cleanup by admin]
http://STOLT-AKERMAN.com - Web & Design agency. Speshitpillt in e-shop, ecommerce and marketing.
http://InfoClip.se - Swedish Antique & Used Books & Art Shop.
http://AkermansCove - Personal Portfolio
Ubuntu LAMP / Joomla 1.5.22 / VM 1.1.6 / JoomFish Contributor / Developer / Designer

akerman

  • Jr. Member
  • **
  • Posts: 325
  • Knowledge weighs Nothing!
    • STOLT/AKERMAN
Re: Optional URL image path set by VM = Problem...
« Reply #1 on: May 06, 2008, 18:31:34 pm »
I've done some more extensive testing on this.

Adding Additional pictures, VM fills in the OPTIONAL URL path by itself.

This forces the user to ONLY insert product images onto the production site.
This since it is impossible to stop VM to insert the URL, even though it's supposed to be optional.

I click the radiobutton to use the 'default Product Image Path'.
Hoping this should be adequate for VM to find the additional images. But no.

Removing the URL doesn't help either. Then VM can't find the image at all.
(Even if the 'default' path has been chosen.)

I really hope this is easy to fix, but right now I think it's a big problem.

If nothing happens w this question in a couple of days I probably will have to make it into a bug report.


Regards
Akerman
http://STOLT-AKERMAN.com - Web & Design agency. Speshitpillt in e-shop, ecommerce and marketing.
http://InfoClip.se - Swedish Antique & Used Books & Art Shop.
http://AkermansCove - Personal Portfolio
Ubuntu LAMP / Joomla 1.5.22 / VM 1.1.6 / JoomFish Contributor / Developer / Designer

akerman

  • Jr. Member
  • **
  • Posts: 325
  • Knowledge weighs Nothing!
    • STOLT/AKERMAN
Re: Optional URL image path set by VM = Problem...
« Reply #2 on: September 23, 2008, 19:11:34 pm »
It's now passed a couple of months since I wrote the issues above.

It would be interesting to hear if anyone else has the same experience?

The most likely reason for a user (me), to end up with this problem is because I do not update products via Admin in the production site, or use CSV files for this. Simply because running on production site is to slow (1-2 sec/click), and the products are antique/old books. (one item only, many pictures, product type fields and a review system for product quality = many clicks).

So I update a local mirror site (0.2 sec/click  ;)), and then update the appropriate MySQL tables in VM prod. It's quick, simple and gives me full control of deploying products in bulk, with image and all.

So, I ask again; no one else that experience this as an issue: That VM insert a URL value itself, into the prod. additional files, where it clearly states that it is optional?


Regards
Akerman
http://STOLT-AKERMAN.com - Web & Design agency. Speshitpillt in e-shop, ecommerce and marketing.
http://InfoClip.se - Swedish Antique & Used Books & Art Shop.
http://AkermansCove - Personal Portfolio
Ubuntu LAMP / Joomla 1.5.22 / VM 1.1.6 / JoomFish Contributor / Developer / Designer

akerman

  • Jr. Member
  • **
  • Posts: 325
  • Knowledge weighs Nothing!
    • STOLT/AKERMAN
Re: Optional URL image path set by VM = Problem...
« Reply #3 on: September 24, 2008, 12:21:17 pm »
To aid anyone out there that has a problem with this.

N.B. this is just a temporary solution. Hopefully this field will become truly optional in the future. (My whish...)


After updating all related VM Product tables from your development site to your production site, run an SQL Query (in phpMyAdmin if you use that or any other MySQL tool), in order to change a PART of the Additional file URL field.

Updates ALL Additional file URL fields greater than the WHERE value:
-------------------------------------------------------------------------------------------
UPDATE `mydatabasenamehere`.`jos_vm_product_files` SET `file_url` = replace(file_url, 'http://www.mylocalsite.com/', 'http://www.myprodsite.com/') WHERE `jos_vm_product_files`.`file_id` > 1 ;
--------------------------------------------------------------------------------------------
This will check ALL posts within the 'Additional Files' table for your 'local site' file URL name and only change that part to your 'production site'

Replace the:

1. 'mydadbasenameher' with your real database name
2. 'www.mylocalsite.com' with your real local site URL
3. 'www.myprodsite.com' with your real production site URL
(Do NOT take away the slash signs!)

Additional info:

Other things you can change is the 'WHERE' string. This you can set to whatever you like to test on. (Maybe you know that you only want to change 'file_id' higher than 401? then just change 1 into 401.

This Query can be altered in many ways, to effect other fields, or fields in other tables.

Backup is also a good thing to perform...first... ;)

Regards
Akerman
http://STOLT-AKERMAN.com - Web & Design agency. Speshitpillt in e-shop, ecommerce and marketing.
http://InfoClip.se - Swedish Antique & Used Books & Art Shop.
http://AkermansCove - Personal Portfolio
Ubuntu LAMP / Joomla 1.5.22 / VM 1.1.6 / JoomFish Contributor / Developer / Designer

mxride

  • Beginner
  • *
  • Posts: 4
    • mxride.com
Re: Optional URL image path set by VM = Problem...
« Reply #4 on: April 15, 2009, 18:44:51 pm »
Thank you for sharing. I'm using VM 1.1.3 also for old books, I have 70,000+ books (products) loaded. I notice that when I use the optional path to for my images, since I do balk loading to VM, my site becomes extremely slow. This wasn't an issue with VM 1.0.14. By default I see the new VM used a default path, does anyone know where I can change the default image path.
"Little flip of your hair.
And the shape of your feet.
And the way you're looking at me sideways
As we're walking down the street.
I think I like to love to hate to leave you
Need you, want to squeeze you all the time.
Paint me pink with polka-dots, honey,
And take a look at my heart-shaped honeymoon eyes.."

Ryan Montbleau Band

flerd

  • Beginner
  • *
  • Posts: 20
Re: Optional URL image path set by VM = Problem...
« Reply #5 on: May 14, 2009, 12:36:37 pm »
Hi,

have the same problem:
joomla 1.5.10
VM 1.3.1

build a site on localhost... uploaded few sample products...

found out the same you did... change the lines in sql database... it isn't the best thing but it works... :)

but anyway thx for your post, and specialy for keeping the topic updated without any answers! (i hate when someones last post is: "ok.. i've solved it" ... but didn't post his solution...)  ;D

flerd

alelover

  • Beginner
  • *
  • Posts: 1
Re: Optional URL image path set by VM = Problem...
« Reply #6 on: May 16, 2009, 16:06:06 pm »
Hi,
I just moved a site to a new server and need to change the path on my images. I tried this script in phpmyadmin and I keep getting an error. Can anyone help me out on this? I'm running SQL 4.1.22. Thanks.



UPDATE `xcart_images` SET `image_path` = replace(image_path,' /home/content/p/c/c/pccomputers/html/productimages\detailed\','http://www.pc-computers.com/productimages/detailed/')

flerd

  • Beginner
  • *
  • Posts: 20
Re: Optional URL image path set by VM = Problem...
« Reply #7 on: May 19, 2009, 20:48:29 pm »
Hi alelover,

i do it this way:
- downloaded the sql file
- opened with notepad
- find / replace all
find: /home/content/p/c/c/pccomputers/html/productimages\detailed\
replace: http://www.pc-computers.com/productimages/detailed/
- save sql file
- upload

with this you will be able to change all localhost links to live site links.

i hope it helped.

flerd

caseyd

  • Beginner
  • *
  • Posts: 49
Re: Optional URL image path set by VM = Problem...
« Reply #8 on: March 03, 2011, 19:07:47 pm »
FIX:
in theme.php of your template folder:

change line 121 from:
if( $this->get_cfg('useLightBoxImages', 1 )) {
   $html .= vmCommonHTML::getLightboxImageLink( $image->file_url, $thumbtag, $title ? $title : stripslashes(htmlentities($image->file_title,ENT_QUOTES)), 'product'.$product_id );
         }

to:
if( $this->get_cfg('useLightBoxImages', 1 )) {
   $image_link = JURI::root().$image->file_name;
   $html .= vmCommonHTML::getLightboxImageLink( $image_link, $thumbtag, $title ? $title : stripslashes(htmlentities($image->file_title,ENT_QUOTES)), 'product'.$product_id );
   //   $html .= vmCommonHTML::getLightboxImageLink( $image->file_url, $thumbtag, $title ? $title : stripslashes(htmlentities($image->file_title,ENT_QUOTES)), 'product'.$product_id );
         }

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10400
  • VirtueMart Version: 3+
Re: Optional URL image path set by VM = Problem...
« Reply #9 on: March 04, 2011, 02:15:14 am »
you could just change the urls via csv improved to relative

http://forum.virtuemart.net/index.php?topic=59414.0
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)