Manufacturer URL in pop-up window

  • Posts: 223
  • Thank you received: 1
12 years 11 months ago #30073

i know the html to use to have a link open in a pop-up, but can the link for Manufacturer URL be made to open in a pop up?

would this be done on the show.php page, and what would the code need to be?

thanks

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

  • Posts: 82796
  • Thank you received: 13356
  • MODERATOR
12 years 11 months ago #30091

Indeed the manufacturer URL could be made to open in a popup. It is displayed by the code:

echo JText::sprintf('MANUFACTURER_URL','<a href="'.$this->element->product_url.'" target="_blank">'.$this->element->product_url.'</a>');

in the file "show" of the "product" view that you can edit via Display->Views.
You could use that code instead:
JHTML::_('behavior.modal');
echo JText::sprintf('MANUFACTURER_URL','<a class="modal" rel="{handler: \'iframe\', size: {x: 450, y: 480}}" href="'.$this->element->product_url.'" >'.$this->element->product_url.'</a>');

Last edit: 12 years 11 months ago by nicolas.

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

  • Posts: 223
  • Thank you received: 1
12 years 11 months ago #30135

nicolas,

inserted code, but when i try and view product, receive this error msg:
"Parse error: syntax error, unexpected T_ECHO in /home/advplbg/testsite.decorativeplumbingonline.com/templates/jsn_epic_pro/html/com_hikashop/product/show.php on line 204"

thanks,
Walter

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

  • Posts: 82796
  • Thank you received: 13356
  • MODERATOR
12 years 11 months ago #30158

I forgot a semi colon in the code. It should be:
JHTML::_('behavior.modal');
and not
JHTML::_('behavior.modal')

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

  • Posts: 223
  • Thank you received: 1
12 years 11 months ago #30174

still not there...

made the change, now page loads, but url show twice, and is not clickable....see image







here is url for page testpage

Attachments:
Last edit: 12 years 11 months ago by plumbingdeals.

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

  • Posts: 82796
  • Thank you received: 13356
  • MODERATOR
12 years 11 months ago #30177

It's definitely not good to do that at 3am :)

The second line should be:
echo JText::sprintf('MANUFACTURER_URL','<a class="modal" rel="{handler: 'iframe', size: {x: 450, y: 480}}" href="'.$this->element->product_url.'" >'.$this->element->product_url.'</a>');

and not:
echo JText::sprintf('MANUFACTURER_URL','<a class="modal" rel="{handler: 'iframe', size: {x: 450, y: 480}} href="'.$this->element->product_url.'" >'.$this->element->product_url.'</a>');

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

  • Posts: 223
  • Thank you received: 1
12 years 11 months ago #30179

so i'm not the only one who works on websites when i should be sleeping :)
meanwhile, now result is:
Parse error: syntax error, unexpected T_STRING in /home/advplbg/testsite.decorativeplumbingonline.com/templates/jsn_epic_pro/html/com_hikashop/product/show.php on line 204

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

  • Posts: 82796
  • Thank you received: 13356
  • MODERATOR
12 years 11 months ago #30180

Ah yes, it should be: \'iframe\' instead of 'iframe' on that line.

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

  • Posts: 223
  • Thank you received: 1
12 years 11 months ago #30187

there we go!

you are the best! I made a minor tweak to change size, but otherwise it is perfect!

final result can be seen here:
here is url for page testpage

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

  • Posts: 102
  • Thank you received: 0
12 years 11 months ago #30192

can i get in on this??
i would like to show my products in a native popup instead of using a plugin (what i was doing)
so that when you click to see options just a little box appears with the price and quantity and add to cart.

i have already formatted the product page for this.
here is what i did for the call to it
<?php JHTML::_('behavior.modal');
?>
<div id="options"><a href="<?php echo $link;?>" class="modal" rel="{handler: 'iframe', size: {x: 450, y: 480}}">
<?php
echo 'Choose Options';
?>
</a>
</div>

the problem is it opens a page with the whole site template around it and not just the content of that particular product. is ther a way to do this?
thanks, liz

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

  • Posts: 82796
  • Thank you received: 13356
  • MODERATOR
12 years 11 months ago #30193

You should add &tmpl=component in the URL.

So the line:
$link = hikashop_completeLink('product&task=show&cid='.$this->row->product_id.'&name='.$this->row->alias.$this->itemid.$this->category_pathway);

should be:
$link = hikashop_completeLink('product&task=show&cid='.$this->row->product_id.'&name='.$this->row->alias.$this->itemid.$this->category_pathway.'&tmpl=component');

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

  • Posts: 102
  • Thank you received: 0
12 years 11 months ago #30194

so when i used the plugin and i did this, when you clicked submit it closed that iframe. this doesnt do that. where do i / what do i do with the submit button to cause the window to close on submit?

and preferably take you to the cart page in the main window?

Last edit: 12 years 11 months ago by MinnieMouse.

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

  • Posts: 82796
  • Thank you received: 13356
  • MODERATOR
12 years 11 months ago #30205

You will have to change the line:
$js = 'window.location = \''.urldecode($url).'\';';

to:
$js = 'window.parent.location = \''.urldecode($url).'\';';

in the file administrator/components/com_hikashop/helpers/cart.php
so that it's the main page which is refreshed.

You could also do that modification with a hikashop_cart_js_render template override as explained in the developer documentation but it's more complicated.

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

  • Posts: 102
  • Thank you received: 0
12 years 11 months ago #30218

okay so those instructions are not that complete for this do i?
templates/YOUR_TEMPLATE/html/hikashop_cart_js_render.php with the code from cart.php but with your alteration from below? do i replace the whole file or just the function in that section of cart.php?

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

  • Posts: 82796
  • Thank you received: 13356
  • MODERATOR
12 years 11 months ago #30227

If you don't know PHP, you should stick with the simple modification I gave. That should already solve your problem.

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

  • Posts: 102
  • Thank you received: 0
12 years 11 months ago #30229

okay i just did it the initial way without the override and it doesn't work. things are added to the cart but the popup doesnt close.

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

  • Posts: 82796
  • Thank you received: 13356
  • MODERATOR
12 years 11 months ago #30233

Could you give a link so that we can see what you did ?

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

  • Posts: 102
  • Thank you received: 0
12 years 11 months ago #30254

sorry, didnt get notified that you wrote back.
www.dnbsandbox.com/markethall/pasta-shop...ping/product/listing

click any item to choose options and the product->show page opens then submit it to the cart and you will see it--well, not happening ;-)

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

  • Posts: 82796
  • Thank you received: 13356
  • MODERATOR
12 years 11 months ago #30302

Please turn off the option "Use AJAX when possible for add to cart buttons" in the configuration and try again.

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

  • Posts: 102
  • Thank you received: 0
12 years 11 months ago #30343

thank you that did it!!

[EDIT] sorry, almost did it. now the ajax that controls the variation name doesnt work. so if you pick a variation/characteristic... it should change the title.. and then put the right one in the cart. now it doesnt do that.

L

Last edit: 12 years 11 months ago by MinnieMouse.

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

Time to create page: 0.073 seconds
Powered by Kunena Forum