Publisher does not support the Fluid field type. Please do not contact asking when support will be available.

If you purchased an add-on from expressionengine.com, be sure to visit boldminded.com/claim to add the license to your account here on boldminded.com.

Ticket: How to deal with Cartthrob (relationship translations)

Status Resolved
Add-on / Version Publisher 3.5.1
Severity
EE Version 5.3.1

pixi

May 05, 2020

Hi Brian,

I have to offer products in multiple languages. So, as recommended by the doc I used this tag

{exp:publisher:translate_entry entry_id="{entry_id}"}
    {title}
{/exp:publisher:translate_entry}

around Cartthrob outputs but it doesn’t work (even for the {title} tag).

So, I said to myself : If it doesn’t work like this, try to set the Publisher settings to ignore the products channel and create a product entry for the FR and another entry for the NL version. Then, in the FR version of event, choose the FR version of the product in the relashionship field and in the NL version of the event, choose the NL entry of the product but the relashionship field is locked on the product’s version chosen in the default language of the event. Can you guide me on the solution to adopt please?

I know it is not a bug but it’s still a show stopper and my website is almost done when I discover this critic point… :-s

I hope you can help me on this. THanks in advance.

 

 

#1

BoldMinded (Brian)

You shouldn’t have to use the translate_entry tag if the products channel isn’t ignored by Publisher, each product should have a translation just like any other entry. Note you can also use the publisher_lang_id=”X” on an entries tag to force it to load content in a language other than what the site is currently set to.

#2

pixi

That is what I made in the first place : treating products like any other entry and not setting any ignore setting but it didn’t work, that’s why I tested the other way that doesn’t work better.

I have an events channel where I “attach” products (from products channel) to event entries with relashionship field. When I output on templates, product names, options,… arent’t translated. In FR events I see the product’s informations attached/called by the relashioship field in FR as it should and in NL events I see the product’s informations attached/called by the relashioship field in FR instead of NL…

#3

BoldMinded (Brian)

If I were you I would try to make this work without Cartthrob in the picture. Make a new EE install with just Publisher, and then setup your relationship and template code to get it to work, then install Cartthrob and see what happens.

#4

pixi

Hi Brian, I just did what you adviced me to do. I don’t have installed Cartthrob yet because without it I can already see that when visualizing my FR event entry, the product related by relashionship field is in french but when I switch to NL the event entry is translated but not the product informations.

Is it possible that relashionship publisher bond bugs?

On another note, for my general issue with Cartthrob I thought : will it not be more interesting for me to : - set the ignore setting for product channel - disable relashionship persistence and create a product entry in FR and another entry in NL - then in the FR version of event choose the FR product entry and in the NL version of event choose the NL product entry Because anyway I will get in troubles when I’ll have to send order notifications by email as Cartthrob email templates don’t parse publisher phrases ans tags….

What do you think? Thanks in advance.

#5

BoldMinded (Brian)

Please provide screenshots, or preferably a video, of what you are seeing with the relationship field. The description you provided isn’t enough for me to fully understand the situation.

#6

pixi

Comment has been marked private.

#7

BoldMinded (Brian)

Comment has been marked private.

#8

pixi

is the bild you propose later than the 5b43185d ? Because you solved a bug for me on april 20th with this build, i want to make sure to not crush/overwrite it.

#9

BoldMinded (Brian)

What was the other ticket in which I sent a build? I can’t seem to find it.

#10

pixi

https://boldminded.com/support/ticket/2112

#11

BoldMinded (Brian)

Ok, that ticket isn’t specific to relationship tags. Yeah, I’m going to need CP and FTP access to a dev site to dig into this.

#12

pixi

I just edited the ticket to give you the access.

#13

BoldMinded (Brian)

Try using the relationship tag pair instead of accessing the fields directly. It seems to work that way.

{exp:channel:entries channel="evenements" limit="1" show_expired="yes" show_future_entries="yes" disable="categories|category_fields|member_data|pagination"}
<h1>{title} ({entry_id})</h1>

{!--
product's infos provided by the relashionship field that should be translated but are not : 
product's title : {produit:title}
product price : {produit:the_price}
product description : {produit:description}
--}

{produit}
 product's title : {produit:title} ({produit:entry_id})
 product price : {produit:the_price}
 product description : {produit:description}
{/produit}

{/exp:channel:entries}
#14

BoldMinded (Brian)

I’ll look into why it isn’t working with the single variables, but for now the tag pair should get you started.

#15

pixi

As I just wanted to test the tag pair solution on my real dev website (the one with Cartthrob) I saw that I already use the relashionship tag pairs actually but it doesn’t work. I edited the ticket to give you the credential access to this dev website, so you can see.

You’ll see the {produit} relashionship field tag pair in action in evenements.group > evenement.html

If you manage to solve the relashionship issue, then when the product will be added to cart, will it be translated in the cart?

Thanks.

#16

BoldMinded (Brian)

Double check your real dev site for errors. My test yesterday showed that the tag pairs work, so there must be something different in your other dev environment.

As for if the entry will be translated in the cart… I don’t know, it depends on how Cartthrob queries the data. If it isn’t translated, then you can use the publisher:translate_entry tag.

#17

pixi

You’re right, classic custom field are translated between relashionship tag pairs. I made some other tests and I think I got it : in fact the field that is not translated is a CartThrob Price Modifiers Configurator. (If you have to see, I put back the credentials of the blank website in the ticket)

Price Modifiers Configurator are not taken in charge (sorry, don’t know if it is said like that in English) by Publisher? 😱

Or is there something special to do to make it work?

I asked Cartthrob team before purchase and they told me this: “I haven’t heard of any CartThrob/Publisher issues with price modifiers, so I think you should be fine there. Based on Publisher’s docs, https://docs.boldminded.com/publisher/requirements, they said the add-on is compatible with CartThrob and it sounds like the way they store their data won’t conflict, https://docs.boldminded.com/publisher/faqs”.

For the cart I made a test with {exp:publisher:translate_entry entry} tag but this not seems to translate (even classic fields).

#18

BoldMinded (Brian)

You might need to use a variable prefix

{exp:publisher:translate_entry entry_id="1" var_prefix="translation:"}
{translation:title}
{/exp:publisher:translate_entry}

TBH, I haven’t actually used Cartthrob in 7 or 8 years, so I don’t know how compatible it is with Publisher, but I do know that people have used the two together with success. You might just have to figure out what works for you and what does not. If it does not work, then I can’t do much about it other than add a hook to Publisher’s code that a 3rd party module can use. I didn’t design Publisher to add support for other modules directly in it’s codebase, that would be a nightmare to support. The only add-ons Publisher supports natively are Grid, Relationship, Assets, and Bloqs as they were the most popular add-ons, and after adding support for those I vowed not to add support directly in Publisher for any other 3rd party modules.

#19

pixi

I’ll take the workaround (ignore channel + create 1 entry per translation + disable persistence for relationship field) path then. It is not the ideal way but that’ll do the trick.

I suppose the fix for the single relationship tag will be added in the next release? Meanwhile, I’ll go with the tag pair.

Let me say I totally understand your point, thanks for your always kind and pro support.

The thing is Cartthrob became essential as it is now the only complete e-shop solution out there and Publisher is the most robust translation add-on in my opinion so it would be nice if developers of must have add-ons could talk to each other to create hooks and code to maximize the compatibility between these add-ons.

Login to reply