Manufacturer URL in pop-up window

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

for those who wish to do this as an override--really preferable to a core hack which is hard to keep track of. i did create the file /templates/MYTEMPLATE/html/com_hikashop/hikashop_cart_js_render.php as above and then just included the following:

$js='';
if($this->cartCount()!=1 && !empty($url)){
$js = 'window.parent.location = \''.urldecode($url).'\';';
}
$js = '
function hikashopModifyQuantity(id,obj,add,form){
if(add){
add=\'&add=1\';
}else{
add=\'\';
}
var qty=1;
if(obj){
qty=parseInt(obj.value);
}
if(form){
var varform = eval(\'document.\'+form);
if(varform){
varform.submit();
}
}else{
try{
new Ajax(\''.$baseUrl.'product_id=\'+id+\'&quantity=\'+qty+add+\''.$url_itemid.'&return_url='.urlencode(base64_encode(urldecode($url))).'\', { method: \'get\', onComplete: function(result) { var hikaModule = window.document.getElementById(\'hikashop_cart_module\'); if(hikaModule){ hikaModule.innerHTML = result;} '.$js.'}}).request();
}catch(err){
new Request({url:\''.$baseUrl.'product_id=\'+id+\'&quantity=\'+qty+add+\''.$url_itemid.'&return_url='.urlencode(base64_encode(urldecode($url))).'\', method: \'get\', onComplete: function(result) { var hikaModule = window.document.getElementById(\'hikashop_cart_module\'); if(hikaModule){ hikaModule.innerHTML = result;} '.$js.'}}).send();
}
}
return false;
}
';
}



which is the code with the modification from the cart php page. but just the part of the cart.php page relevant to that function.

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

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

so i edited the other post that the variants dont update the item in the new popup.

here is the error i get when i try
hikashopUpdateVariant is not defined.

[moreinfo] so right now i am using the handler URL instead of iframe because it says to do that in the joomla docs for an internal page. so with the handler as url the modal closes on submit but the variations dont update.

if i do use an iframe instead then the submit doesnt close the popup but the variation DOES update.

any thoughts?

liz

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 #30386

Indeed, you should use an iframe, otherwise, the javascript won't work for the variant selection.

The popup will close if you do the override properly.
You should create the file templates/YOUR_TEMPLATE/html/hikashop_button.php and create in it the function hikashop_cart_js_render which would return the $js variable.

somthing like that:

<?php
function hikashop_cart_js_render($url){
$js = 'ALL your javascript';
return $js;
}

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

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

nicolas, thank you so much for helping me get this working.

okay i scrapped the js override for simplicity sake. i just changed the original line like you said in cart.php.
i made it an iframe.

the popup loads. the variation works. then when you click submit the cart window loads in the iframe, the iframe does not close...

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

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

Could you activate the option "Use AJAX when possible for add to cart buttons" 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 #30454

Awesome, now it all works. THANK YOU!!!!

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

  • Posts: 95
  • Thank you received: 1
11 years 9 months ago #88360

One year later ...

I'm trying the same and added this lines in the show_block_dimensions.php (HikaShop 2.0):

JHTML::_('behavior.modal');
echo _('<br />').JText::_('MANUFACTURER').': '.'<a class="modal" rel="{handler: \'iframe\', size: {x: 600, y: 350}}" href="'.hikashop_completeLink('category&task=listing&cid='.$manufacturer->category_id.'&name='.$alias.'&Itemid='.$Itemid).'" >'.$manufacturer->category_name.'</a>';

It's working well, but I don't want all my homepage (with the right content in the right place) in the popup-window.
Can you help me that only the content of the manufactures will be displayed in the popup?

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

  • Posts: 82796
  • Thank you received: 13356
  • MODERATOR
11 years 9 months ago #88517

In your code, instead of:
category&task=listing&cid=

use:
category&tmpl=component&task=listing&cid=

and that will only display the main area in the popup.

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

  • Posts: 95
  • Thank you received: 1
11 years 9 months ago #88575

thanks! - this is!

Now it's working right, but one more thing:
Sometimes the content no appears. After opening some pages (home or other product pages) the content appears right in the popup (now only the main area like should be).
This problem had figured also without popup-window (the main area appears without content sometimes).

You have an idea?

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

  • Posts: 26152
  • Thank you received: 4027
  • MODERATOR
11 years 9 months ago #88821

Hi,

Would it be possible to have a screenshot ?

Thanks,


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: 95
  • Thank you received: 1
11 years 9 months ago #89541

Yes, after view days I can find the same problem. Seams to be a Opera-Browser problem, why I attached two pictures: without content in Opera and with the content in IE.

Have you an idea, why this things happen?

Attachments:

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

  • Posts: 95
  • Thank you received: 1
11 years 9 months ago #89733

Now I have the problem in all browsers. I think I haven't change anything around the link.

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

  • Posts: 82796
  • Thank you received: 13356
  • MODERATOR
11 years 8 months ago #90022

That sounds like either a SEF or a template issue.

Can you try to turn off the SEF in the joomla configuration and see if that helps ?
Can you try to switch your template with the default one and see if that helps ?

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

  • Posts: 95
  • Thank you received: 1
11 years 8 months ago #90526

The changes of the SEF in joomla no changed nothing.
But now I've tryed change the SEF in HikaShop and it seams that's worked ... till now.

I can't change the template, because in other templates the parts (modules and so on) no figured. (I would have to installate that all for testing.)

My site is working on XAMPP - I will put all online soon ... and then I will testing more.

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

  • Posts: 95
  • Thank you received: 1
11 years 8 months ago #90714

Now, all my problems are online. Have a look here:
www.nicething.de/nicething/index.php/gla...1-black-russian-glas

On the right is the "Brand" Designer-Link. This opened a popup-window with Designer-Details - sometime its working, but not always.

One thing more: If I want buy the product it will figured in the cart. But sometimes I can't open the cart ("Warenkorb" on the top). Offline works, but online its a hazard-thing.

And other thing more:
I want that the delivery costs of every product depended on the weight. I have set various manual shipping methods (e.g. 201gr to 500gr cost 3,50 Euro). If I put a product in the cart, it count automatically the weight and choose the shipping method. Sometimes works a bit, but in the mayor times isn't working right. Also when I delete the product in the cart isn't changing the delivery costs by the new weight.

Probably is too much for this thread. I need a lot of help. Please try it to help me.

All site is only for testing (you will buy nothing ;-)
If is better to be logged in you can do it on the top "Mein Konto" with 'guest' and 'pass'

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

  • Posts: 26152
  • Thank you received: 4027
  • MODERATOR
11 years 8 months ago #91008

Hi,

I didn't have special problem with the popup.

About the cart link, it redirect to an HTTPS page which is not supported by the server. You should remove the option in order to stay in HTTP during the checkout (or activate the https for this website).

For the weight problem, we have a plugin named "shipping price per product" which would allow you to specify a shipping price per product.

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: 95
  • Thank you received: 1
11 years 8 months ago #91056

Hi Jerome,
thanks for the fast reply.

The popup of the "Designer" is a lot of times empty (see actually screenshot). I don't know why. (After clicking some sites is appearing sometimes.)

Thanks for give me the hint to http - I ignored that. Now is working.

About the shipping method:
I don't want a price per product. It would be nice, that I can determinate a weight-"area" e.g. 501g - 2000g will cost 5,50 Euro. Then the amount of the weight of various products count automatically the shipping price (e.g. 150g + 300g + 200g = 650g -> 5,50 Euro).
I 've tryed it (see the attached files) and sometimes it is working a bit - but not sure (you can test it on my site).
Also I have set, one time for testing, the price per product and it dosn't working right too. I think the manual shipping method no is working fine on my site.

Can you help me to solve this two open problems?

Thanks for all!
j.

Attachments:

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

  • Posts: 95
  • Thank you received: 1
11 years 8 months ago #91064

please read my last message.
I found this answer from Nicolas:
"
You can do that with weights:
Set a weight of 1kg for each of your products.
Then, create three manual shipping methods like that:
from 0 to 10.5kg => 3 euros
from 10.5 to 20.5kg => 10 euros
from 20.5 to 50.5kg => 20 euros
"
in this thread:
www.hikashop.com/fr/forum/4-how-to/35442...unt-of-products.html

This is what I want ... only more specific with a own weight each product.

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

  • Posts: 95
  • Thank you received: 1
11 years 8 months ago #91070

Seams to work with adding new products, but if I want change the number of products or I want to delete a product - both with the buttons in the cart - the new amount of all weight no will be counted well and the shipping costs are deleted (if I put after that a new product sometimes I recived the right price-sum of shipping)

Maybe is the foult in this two changing-buttons in the cart?

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

  • Posts: 95
  • Thank you received: 1
11 years 8 months ago #91077

For the problem with the empty popup. I've tested it more and I've seen that the link is different when it won't work.
If ends with "...tmpl-component" its going right. But if ends with "...tmpl-component?Itemid=468" will be appear empty (see attached screenshot).

Of which depend it on - no idea.

Can you help me, please?

Attachments:

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

Time to create page: 0.078 seconds
Powered by Kunena Forum