Separate database for hikashop component?

  • Posts: 175
  • Thank you received: 0
10 years 2 weeks ago #200351

-- HikaShop version -- : 2.3.3
-- Joomla version -- : 3.36

Hi, is it possible to use a separate database for hikashop?

i want to create multiple website that have hikashop and access 1 global database. Only for their hikashop data.

is it possible?

Thank you in advance

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

  • Posts: 83798
  • Thank you received: 13570
  • MODERATOR
10 years 2 weeks ago #200373

Hi,

HikaShop has to be on the same database as Joomla since HikaShop is a Joomla extension.

What you can do is use the extension JMS multisites to have one master website with slave websites so that you would effectively have one database for all the websites.
I invite you to contact JMS multisites with your project so that they can tell you what is possible exactly with their product for your needs:
www.jms2win.com/index.php

The following user(s) said Thank You: veeco

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

  • Posts: 175
  • Thank you received: 0
10 years 1 week ago #201200

Hi

i've seen the jms2win and i think it's a bit too much since i only need to synchronize hikashop's product part between 3 database

I want to create a manual csv import for hikashop that import CSV containing product's data to 3 database

Is there any list of hikashop's product table ? i need to know which table i need to synchronize between 3 database

thank you

Last edit: 10 years 1 week ago by veeco.

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

  • Posts: 83798
  • Thank you received: 13570
  • MODERATOR
10 years 1 week ago #201209

Hi,

Here is the list:
hikashop_product hikashop_price hikashop_related hikashop_variant hikashop_characteristic hikashop_product_category hikashop_category hikashop_file

The following user(s) said Thank You: veeco

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

  • Posts: 175
  • Thank you received: 0
10 years 5 days ago #201486

Hi, Thank you for your answers

Turns out synchronizing isnt very effective

so now i need to create an import that reads csv file and directly update all 3 database

is there any easy API to insert product category and products? [including custom fields]

edit: i have tried - www.hikashop.com/forum/4-how-to/3958-how...cts-through-api.html

the problem i have right now is the price and category doesnt save


my code


backend view [need to modify the cid link because the product isnt displayed anywhere(no category)]

any suggestion?

Last edit: 10 years 5 days ago by veeco.

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

  • Posts: 83798
  • Thank you received: 13570
  • MODERATOR
10 years 5 days ago #201514

The save function of the class.product API doesn't insert the prices or the categories.
After the call to the save function, you want to call the updateCategories and the updatePrices functions of class.product.
You can see an example of that in the saveForm function of the class.product API:

		if($status){
			$status = $this->save($element);
		}else{
			JRequest::setVar( 'fail', $element  );
			return $status;
		}

		if($status){
			$this->updateCategories($element,$status);
			$this->updatePrices($element,$status);
			$this->updateFiles($element,$status,'files');
			$this->updateFiles($element,$status,'images',$element->imagesorder);
			$this->updateRelated($element,$status,'related');
			$this->updateRelated($element,$status,'options');
			$this->updateCharacteristics($element,$status);
			$class->handleTranslations('product',$status,$element);
		}

The following user(s) said Thank You: veeco

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

  • Posts: 175
  • Thank you received: 0
10 years 4 days ago #201599

Thanks, i managed to get the category and price to work

however,i cant update files.

I want every product to have "product-code".jpg

this is my code


*it's supposed to be updateFiles($product,$product_id,'images');



another question:
after i set the path of images for the product, where should i copy my images to?
also, is there any documentation on the parameters of updateFIles()? [and other update function that can be used]

Thank you

Last edit: 10 years 4 days ago by veeco.

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

  • Posts: 83798
  • Thank you received: 13570
  • MODERATOR
10 years 4 days ago #201654

Hi,

The updateFiles function doesn't save the images in the database but update the link between the images and the product.
So you can't use such code.
You would need to do it like that:

$image = new stdClass();
$image->file_ref_id = $product_id;
$image->file_type = 'product';
$image->file_path = $code.'.jpg';
$fileClass = hikashop_get('class.file');
$id = $fileClass->save($image);
$product->images = array($id);
$productClass->updateFiles($product,$product_id,'images');

You can put the images in the path that you specified in the "upload folder" setting of the HikaShop configuration.

There is no documentation for the functions of the class API of HikaShop. We would first need to have clean standard functions in order to produce a documentation. The functions we have in the class API were meant to be used internally only at first and not so that any developer would use them.

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

  • Posts: 175
  • Thank you received: 0
10 years 2 days ago #201816

Hi, thanks

the code worked and both the image in database and the back end shows but only shows as default image

i've tried to copy file in the folders inside media/com_hikashop, and it's still not working [still showing the default image]

any solution for this?




Also, just a suggestion. I think the class hikashop API could be very useful for developer and having a proper documentation about it would help a lot

Thanks


edit: it worked, turns out i need to copy paste the image in the upload folder

Last edit: 10 years 2 days ago by veeco.

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

Time to create page: 0.068 seconds
Powered by Kunena Forum