0
The problem:
I am using MusCol to display music and a component called J2Store to manage purchases. At present I can create a song as a product in J2Store, then enter the product page in the MusCol song's buy link. The user then goes to the product page and adds the product to the cart.
This is too many steps for my liking, and I would like to have the add to cart button for a song appear on it on the album page (SEE ATTACHED IMAGE)
My attempted fix:
J2Store allows a shortcode - {j2store}X|cart{/j2store} - which I can insert into html fields to call the cart button for a product (where X is the product ID). In MusCol the 'review' field allows HTML, so if I can call the review in another field I can get the cart button, so for the 'Price' field on the Album page, I added album->review ?> which then calls and executes the shortcode, and I have a cart button for the album. So far so good.
Where I'm stuck:
Unfortunately in the song itself, simply echoing $this->song->review doesn't work, I assume because I'm not on the song page.
I noticed that you call {{name}} and {{artist}} to get the title and artist for the song, but when I try {{review}} I get the shortcode echoed as text and html tags, rather than a button.
The questions:
How can I get the shortcode from the song's review field to echo correctly and add a cart for the song to the song area on the album page?
Is there a way I can make one of the other album fields on the admin page accept the shortcode instead of putting it in review? (I use the review field for other things to so if I could make Edition Details (or something) work instead that would be great).
Thanks.
I am using MusCol to display music and a component called J2Store to manage purchases. At present I can create a song as a product in J2Store, then enter the product page in the MusCol song's buy link. The user then goes to the product page and adds the product to the cart.
This is too many steps for my liking, and I would like to have the add to cart button for a song appear on it on the album page (SEE ATTACHED IMAGE)
My attempted fix:
J2Store allows a shortcode - {j2store}X|cart{/j2store} - which I can insert into html fields to call the cart button for a product (where X is the product ID). In MusCol the 'review' field allows HTML, so if I can call the review in another field I can get the cart button, so for the 'Price' field on the Album page, I added album->review ?> which then calls and executes the shortcode, and I have a cart button for the album. So far so good.
Where I'm stuck:
Unfortunately in the song itself, simply echoing $this->song->review doesn't work, I assume because I'm not on the song page.
I noticed that you call {{name}} and {{artist}} to get the title and artist for the song, but when I try {{review}} I get the shortcode echoed as text and html tags, rather than a button.
The questions:
How can I get the shortcode from the song's review field to echo correctly and add a cart for the song to the song area on the album page?
Is there a way I can make one of the other album fields on the admin page accept the shortcode instead of putting it in review? (I use the review field for other things to so if I could make Edition Details (or something) work instead that would be great).
Thanks.
Responses (6)
-
Accepted Answer
-
Accepted Answer
0hi
yes, this won't work because the songs's "review" field is loaded using AJAX and is NOT processing any content plugins in it (like the j2store plugin you need)
this would require actually to trigger the plugin process in the backend, prior to sending the info to the frontend.
but that could cause problems as well, because this plugin *might* require some additional Javascript that is not loaded in the page...
this will require custom coding in any case... -
Accepted Answer
-
Accepted Answer
-
Accepted Answer
Your Reply
Please login to post a reply
You will need to be logged in to be able to post a reply. Login using the form on the right or register an account if you are new here.
Register Here »