Links To Share Product / Image

  • Posts: 10
  • Thank you received: 3
11 years 6 months ago #142870

I was wondering if there was a plugin or "hack" I could do that will allow me to share the image of a product, for example with photobucket on the right hand side you have the share options, Email & IM / Direct / HTML / IMG Tag.

I would like to have these options so that I can share the image on a forum for example, or email etc.

I have added some code in the "Display - product / show.php" as per a previous thread I read which puts a module of "Load position" in the product page.

$mypostion="{loadposition shareprod}";
echo JHTML::_('content.prepare',$mypostion );
where shareprod is my module. This is a module that accepts php so I was going to try and call the image of the page and convert to a url that can be copied and pasted.

My thought was to put it in a table like this:
<table style="width: 100%">
<tbody>
<tr>
<td style="width: 15%">Email And IM</td>
<td style="width: 85%"><p>www.thetrailerbox.com<?php echo URL TO IMAGE ?>.html</p></td>
</tr>
<tr>
<td style="width: 15%">Direct</td>
<td style="width: 85%"><p>www.thetrailerbox.com<?php echo URL TO IMAGE ?></p></td>
</tr>
<tr>
<td style="width: 15%">HTML</td>
<td style="width: 85%"><a href="www.thetrailerbox.com<?php echo $_SERVER['REQUEST_URI'] ?>" target="_blank"><img src="www.thetrailerbox.com/<?php echo URL TO IMAGE ?>" border="0" alt="<?php echo NAME OF PRODUCT ?>"/></a></td>
</tr>
<tr>
<td style="width: 15%">IMG Tag</td>
<td style="width: 85%">[IMG]www.thetrailerbox.com<?php echo URL TO IMAGE ?>[/IMG]</td>
</tr>
</tbody>
</table>

Can you help at all?

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

  • Posts: 10
  • Thank you received: 3
11 years 6 months ago #142872

Just to add I have searched and searched the code to try and figure this out myself but im stuck now. I cant find how to call an image through this anywhere

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

  • Posts: 26266
  • Thank you received: 4044
  • MODERATOR
11 years 6 months ago #142914

Hi,

I am not sure that I understood what you are asking for.

Your module will be displayed in the product page but your module is a module. If it wants some information, it will have to read the current url (using JRequest::getVar) to know which page is open.

But the best solution will be to not use a module and use a view override instead.
At this moment you will read all product data without any problem.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 10
  • Thank you received: 3
11 years 6 months ago #142922

OK then, any idea how I can do that then? Do you understand what I am trying to achieve? Forget for the moment how im trying to achieve it as I understand a module isnt a great way forward. But if you understand what i am trying to achieve you may be able to help me in achieving it

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

  • Posts: 84243
  • Thank you received: 13689
  • MODERATOR
11 years 6 months ago #143003

As Jerome said, you should edit the view file of the product page in order to add your custom code.
You can take example on the show_block_img view file for an example on how to get the URL of the images of the product.

Best regards,
Nicolas

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

  • Posts: 10
  • Thank you received: 3
11 years 6 months ago #143080

Not sure what you mean by the view file for the product page? Do you mean the Display - product / show.php that I was editing to include the module or a different file?

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

  • Posts: 12953
  • Thank you received: 1778
11 years 6 months ago #143215

Hi,
What he meant was probably to :
1. Take example of the "show_block_img" file of the "product" view to find the URL of your image
2. Add you custom code through the files of of your "product" view of your front-end template through "Hikashop->Display->Views"
Also, note that adding your code through the "show_default"/"show_tabular" file (it will depend of your product page type of layout) of the product view will probably do the job.

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

  • Posts: 10
  • Thank you received: 3
11 years 6 months ago #143284

Thank you for pointing me to the correct file, "show_default" all sorted, jsut gotta try and get it to automatically copy now when its clicked

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

Time to create page: 0.061 seconds
Powered by Kunena Forum