Taking J2Store for a spin, need some guidance

JackGoa

Member
Hi, I am testing out the J2Store plugin to see if it might work for one of my projects.

I followed the instructions on this wiki page, http://fabrikar.com/forums/index.php?wiki/j2store-form-plugin/, to the T.

When I go to my list in the frontend, I get a 5oo error. Debugging tells me this:

Unknown column '#__j2store_taxprofiles.tax_profile' in 'field list'

Logic tells me, there might be a bug whereby the # is not getting replaced with the site's db prefix?

I tried simply not filling that field in in the form plugin as I do not actually need it, but the error remains.

Is this a possible bug, or have I maybe missed something?

And while I'm at it, do I need to change anything about my list/menu item configuration so that once I get it going, the "Add To Cart" button will display next to each record?
 
Last edited:
UPDATE

I unpublished the tax_profile element and then ran into the same issue with the other two db joins, length_class and weight_class.

So I unpublished them too and managed to get the list to load! However, at the end of each record I get this:

Product not found (source %s, id %s)

PS, I should probably just mention. I did not start with a fresh form. This is a populated list and I just added the additional elements as per the instruction on that wiki page. This probably has something to do with it, hey?
If so, any ideas how I can get the existing records to become products? All those new fields are now obviously empty and probably need to be filled with something?
 
Last edited:
Do you have J2Store installed?
And the Fabrik J2Store System plugin?
 
Last edited:
It's working.
You must make sure that "Enabled" and "Visible in Frontend" are set correctly (so using {j2store_test___enabled_raw} and {j2store_test___visible_raw} in case of radio or yesno)

And
You must edit and resave each of your existing records to create the products in j2store.

---------------------------------------------------------
Or create the j2store products manually: as far as I can see in #_j2store_products you need at least to set
visibility = 1
product_source = com_fabrik.X (X= your list id)
product_source_id = your record id
product_type = simple or downloadable
enabled =1


Edit:
This is showing the "Add to cart" in Fabrik but it's not working and I don't see the product in the J2store dashbord, so there seems to be other j2store tables to fill (there are a lot of them)
 
Last edited:
Sherbet, I have a couple of hundred records! Manually is not going to be the way to do it. Will try the other way and maybe do some kind of SQL update query to fill in the missing records.

Monday's worries though! Thanks troester!
 
Ok wait, so are you saying I can export my list, fill the empty fields and then just simply import it to J2Store? I checked, my records aren't showing in the J2Store product list.
 
I just tested.

1. export some product from j2store with the export/import app to get the structure, column headers etc.
2. export your Fabrik list, adapt, add and fill the columns needed for j2store; put your record id not only into product_source_id but put it also e.g. into addtocart_text (so you can reference it later), because
3. the j2store import seems to create always a j2store product with product_source = com_content and product_source_id = a new article id (also creating an empty new article) (no matter that product_source and _id are set differently in the CSV file)
4. in #_j2store_products change all the new products to product_source = com_fabrik.your-listid and product_source_id = your record id from e.g. addtocart_text

This seems to do on my site - but no garantee (and always backup before).
Maybe I missed some setting or the Fabrik j2store system plugin has to support something for import or it's just a bug/restriction of the import app...
 
Iirc, there's no need to import into j2store. Fabrik just becomes a datastore for those products, and you manage them in Fabrik, not j2store.

-- hugh
 
This is true if you are creating new entries via Fabrik (which will then automatically create a j2store product)

But if you have already existing data in a list before adding the j2store fields and j2store plugin you must edit and save every single record - or do these export/import tricks.
 
Ah, OK. Shows you how much I know, lol.

I've worked on the j2store code (a lot), but never actually used it myself on my own site. Have a few clients who use it, but they all started from scratch, so didn't have the import issue.

-- hugh
 
Digging a bit into the j2store import:
It's inserting into #__j2store_products, #__j2store_variants, #__j2store_productimages and setting hardcoded com_content.

So you must do the "import + then override source and source_id" or fill these tables directly via phpMyAdmin.
 
Hey troester. Sorry for only getting back now. Had to deal with stupid health issues again.

Oki, I created a 'test' product to get something exported.

Now that I have it all in front of me, I'm getting confused. I'm not sure about what you mean with the addtocart_text and product_source_id for instance?
And point number 4?? Hmm? :confused:
And I already have a bunch of fields in my list, so what happens to them?
And will J2Store then by default create a bunch of empty articles?

What are the chances I could send you my two CSV files so you can see what I am sitting with? o_O
 
The j2store import is always creating products with #_j2store_products.product_source = com_content (hardcoded, ignoring settings in your CSV file) and because there is no matching article it's creating a new one (putting its id into #_j2store_products.product_source_id). But the import is also putting the needed stuff into #__j2store_variants (e.g. price, sku...) so I think it's not bad to use this app (instead of doing all on your own).

Your imported products need (in the end) product_source = com_fabrik.X and product_id = your record id
It's easy to change com_content into com_fabrik.X after the import but you need also the record id.
So if (in your CSV file) you are duplicating the record id into the column addtocart_text (I assume you don't really need such a text) you can just copy this value into product_source_id after the import (so overriding this article id inserted by j2store).

Afterward you can empty addtocart_text column (or set a text you like). And delete the empty articles.
It's a kind of hack but seems to be ok on my site.
I would try with only some of your records...

Or you can try to adapt the j2store import so it can handle not only com_content (I think they also have some "Advanced" app you must pay for, maybe this one can do it).
 
:eek:

Give me some time to figure all this out! :oops:

Will get back here with my results as soon as possible.

Thanks!
 
Someone could try talking me into writing an import plugin. Shouldn't be too hard, we've got the free j2store import tool as an example.

-- hugh
 
It's much easier;)
All you need is your Fabrik export having (at least)
product_source product_source_id product_type price sku
com_fabrik.143 11 simple 30 1111-2

AND
remove line 714 in appsimplecsv.php: $this->_insertContent($product);

(there's a test on $content_status but this seems to be always true, I don't see why)
 

Attachments

  • upload_2019-4-4_13-3-29.png
    upload_2019-4-4_13-3-29.png
    12.2 KB · Views: 121
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top