Only import "image file name" from CSV url image path.

  • Posts: 344
  • Thank you received: 3
  • Hikashop Business
10 months 1 week ago #284189

-- HikaShop version -- : 3.2.1
-- Joomla version -- : 3.8.2
-- PHP version -- : 7

My csv file from my supplier has a url images path that looks someting like this:

url 1: https://storage/ma/8fb55831b745485c88ba503f8ae77c13/960999b973f1423680fcfdf600e7f202/800-968-0-jpg.Jpeg/86923F31D96D6796B65762BA98243C1BB78E06EA/04248136_display.jpeg
url 2: https:/m/storage/ma/8433019a058e4a82a50847c1dbd175ab/e3dafc006dbe43f5afe26493e0afc9c2/800-968-0-jpg.Jpeg/BA7F302207B1E9AC2D752A4AE54FAB544DEF68A3/04248135_display.jpeg

I then change this field to "images" so hikashop can import the image.

But I don't want hikashop to import and download the image. I only want hikashop to import "the image file name"

....In the two urls above the "image file name" whould be (the last part of the url)
from url 1: 04248136_display.jpeg
from url 2: 04248135_display.jpeg

I know that I can select "Store images locally" to NO, but then hikashop import the whole url path, and I don't want that.

Can I do some changes in the import.php file in order to make hikashop import the "image name jpg" and without downloading the image itself ?
Because I want to download these images using superfast SSh wget command later.

Hope this makes sense.
Tnx =)

Last Edit: 10 months 1 week ago by river.

Please Log in or Create an account to join the conversation.

  • Posts: 63586
  • Thank you received: 9158
  • MODERATOR
10 months 1 week ago #284205

Hi,

You want to change that code:

if(!file_exists($this->uploadFolder.$name)){
						$content = file_get_contents($image);
						JFile::write($this->uploadFolder.$name,$content);
					}else{
						$size = $this->getSizeFile($image);
						if($size!=filesize($this->uploadFolder.$name)){
							$name=$size.'_'.$name;
							if(!file_exists($this->uploadFolder.$name)){
								$content = file_get_contents($image);
								JFile::write($this->uploadFolder.$name,$content);
							}
						}
					}
					if(file_exists($this->uploadFolder.$name) && (filesize($this->uploadFolder.$name) > 0 || filesize($this->uploadFolder.$name) === false)){
to:
if(true){
in administrator/components/com_hikashop/helpers/import.php

Last Edit: 10 months 1 week ago by nicolas.

Please Log in or Create an account to join the conversation.

  • Posts: 344
  • Thank you received: 3
  • Hikashop Business
10 months 5 days ago #284436

Tnx this works great.

Is it possible that you can make this a function a part of the next Hikashop version ?

For me it is a very good function sinice im using the hikashop as a affiliate store, and Im sure many other would like this function.

Tnx.

Please Log in or Create an account to join the conversation.

  • Posts: 63586
  • Thank you received: 9158
  • MODERATOR
10 months 5 days ago #284444

Hi,

That unfortunately is too specific to make it an option.

Please Log in or Create an account to join the conversation.

Time to create page: 0.085 seconds
Powered by Kunena Forum