Export products-info, manufactures, variant

  • Posts: 56
  • Thank you received: 0
12 years 5 months ago #51661

Hey,

Is it possible to export info about manufactures and variant-name and variant-images when you choose to export the products in
Hikashop?

/Micke

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

  • Posts: 82867
  • Thank you received: 13373
  • MODERATOR
12 years 5 months ago #51729

Hi,

Yes, when you export products via the export button of the products listing, you get the variants and the manufacturer and the images names in the CSV.

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

  • Posts: 56
  • Thank you received: 0
12 years 5 months ago #51738

I thought it should work like that but I can't find manufacturer, variant/variant-images?
Or shall the variant lists togehter with the other products, like under product_name?
Or shall the variant has it own column?

I can see the manufacturer_id but not the name of manufaturer.
Shall it be possible to export/see the name of manufacturers in the csv-file?

Now the CSV-file has the following columns:
product_id
product_parent_id
product_name
product_description
product_quantity
product_code
product_published
product_hit
product_created
product_sale_start
product_sale_end
product_delay_id
product_tax_id
product_type
product_vendor_id
product_manufacturer_id
product_url
product_weight
product_keywords
product_weight_unit
product_modified
product_meta_description
product_dimension_unit
product_width
product_length
product_height
product_max_per_order
product_access
product_group_after_purchase
product_min_per_order
product_contact
product_last_seen_date
product_sales
product_waitlist
product_layout
parent_category
categories_image
categories
price_value
price_currency_id
price_min_quantity price_access
files
images
related
options

followed by several info(like productsnames) in the following columns first row(A-row in excel)...

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

  • Posts: 82867
  • Thank you received: 13373
  • MODERATOR
12 years 5 months ago #51813

In the product_manufacturer_id column, you get the id of the manufacturer.
Variants are added as extra lines: one line for the main product, one line for each of its variants.

If you want to have the name instead of the id of the manufacturer, you will have to edit the file "export" of the view "product" of your back end template via the menu Display>Views. There change:

echo '"'.str_replace('"','""',$product->$column).'"'.$separator;


to:


if($column == 'product_manufacturer_id'){
$categoryClass = hikashop_get('class.category');
$category = $categoryClass->get($product->$column);
echo '"'.str_replace('"','""',$category->category_name).'"'.$separator;
}else{
echo '"'.str_replace('"','""',$product->$column).'"'.$separator;
}

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

  • Posts: 56
  • Thank you received: 0
12 years 5 months ago #51862

Ok, I'll change the code so that the name are exported instead.
Why is this kind of changes something that shall be done manual instead of a "quick" choose/configuration in admin-part?

How about the productprice, is it possible the export annual price with discount?

Last edit: 12 years 5 months ago by Micke_skane.

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

  • Posts: 82867
  • Thank you received: 13373
  • MODERATOR
12 years 5 months ago #51865

Because everyone wants to do something different.
Some wants to remove columns, others wants different things in some of the columns, other formats, etc.
You can't have options for all the possible cases.
It's not possible to export the products price with discounts added.

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

  • Posts: 56
  • Thank you received: 0
12 years 5 months ago #51881

Is there a plugin or something if I want to export prices with discount too websites that list/compare products that customers search for from several vendors?

Is this something that can be programmed if theres not a plugin for export a pricefile with productprice with discount?

I've changed the code you suggested but it still export the ID in product_manufactorer_id and Not the name.
The code looks like this:

foreach($products_columns as $column){
                      /*Här skrivs enbart tillverkar-ID ut*/
			 /*echo '"'.str_replace('"','""',$product->$column).'"'.$separator;*/
                      
                      /*Här skrivs tillverkarnamnet ut*/
                      if($column == 'product_manufacturer_id'){
$categoryClass = hikashop_get('class.category');
$category = $categoryClass->get($product->$column);
echo '"'.str_replace('"','""',$category->category_name).'"'.$separator;
}else{
echo '"'.str_replace('"','""',$product->$column).'"'.$separator;
}
/* Slut på utskrift av tillverkarnamn*/ 
		}
Have edit the code under my template and product/export.php!

Last edit: 12 years 5 months ago by Micke_skane.

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

  • Posts: 82867
  • Thank you received: 13373
  • MODERATOR
12 years 5 months ago #51938

We do it for the google products plugin and for the RSS/Atom feeds.
You could potentially use these to generate exports but the format is XML not CSV.
The google products plugin is in the folder plugins/hikashop and the RSS/Atom feeds are generated with the components/com_hikashop/views/product/view.feed.php file.


That modification looks fine. Are you sure that you are editing the correct file ? If you add a
exit;
line of code, does that stops the processing ?

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

Time to create page: 0.064 seconds
Powered by Kunena Forum