Checkout Printcart

  • Posts: 190
  • Thank you received: 0
10 years 2 months ago #46272

Hi,
what is the proper way to add a css in the view Checkout/Printcart.php ?

My template custom.css is not loaded.
Could you add a specific .css to avoid personnal overrides [just for styling] (it can't be updated with upgrades) ?

Thanks a lot

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

  • Posts: 75861
  • Thank you received: 11845
  • MODERATOR
10 years 2 months ago #46352

Normally, the template should add the CSS files in there too. If that's not the case, the the jdoc include head tag must be missing in the component.php file of the template.
So you should have the frontend CSS file of HikaShop loaded there.

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

  • Posts: 190
  • Thank you received: 0
10 years 2 months ago #46445

I found a YOO popups.css far from the other "stylesheet"
Usually their templates are overloaded by a custom.css not invoked here.
I prefer to avoid modify your frontend_default.css

But I don't know how to expect the display of this page ?
On my browser, it is displayed as a very basic white full page (not a popup). The rest of my template is with a black background.

I have no problem with this (for printing), but for a nicer effect, I'm wondering if it's possible to have a white popup (which can be printed) as the one in Customer profile edition of the frontend ?
Regards

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

  • Posts: 75861
  • Thank you received: 11845
  • MODERATOR
10 years 2 months ago #46559

It should display in a popup. If that's not the case, it's probably that there is a javascript error on the page. Could you look for an error message in the error console of your browser while on the checkout page where you have the print icon?

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

  • Posts: 190
  • Thank you received: 0
10 years 2 months ago #46871

1) In Firefox 11, I have no particular message on Error Console, except some Warnings in frontend_default.css
If I click on Print icon
I get Warnings for .css and :
Warning: Use of getAttributeNode() is deprecated. Use getAttribute() instead.
Source File: xxx.com/component/hikashop/checkout/printcart/tmpl-component
Line: 0
and an Error :
Error: window.top.SqueezeBox is undefined
Source File: xxx.com/component/hikashop/checkout/printcart/tmpl-component
Line: 51

On IE9, the behaviour is the same and I get :
- on loading : SEC7115: Les styles de liens visibles et consultés peuvent avoir une couleur différente. Certains styles n’ont pas été appliqués au lien consulté. checkout
- on click on print icon :
SCRIPT5007: Impossible d’obtenir la valeur de la propriété « close » : objet null ou non défini
tmpl-component, Ligne 51 Caractère 170

Last edit: 10 years 2 months ago by codewarrior.

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

  • Posts: 75861
  • Thank you received: 11845
  • MODERATOR
10 years 2 months ago #46872

My bad, there is no popup for the printcart as it directly output the cart.

If you want to change that, you will have to edit the "printcart" file of the view "checkout" via the menu Display->Views, remove the javascript code, and add a print button with the javascript below in an onclick event:
window.print();

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

  • Posts: 190
  • Thank you received: 0
10 years 2 months ago #46873

but it seems that SqueezeBox is for popups.

I don't understand printcart.php code. Is it intended for sending the cart content to a popup ?

It would be fine if it was working, with the site name on top !

Checkout/cart.php has the following code to invoke Printing :

<a title="<?php echo JText::_('HIKA_PRINT');?>" class="modal" rel="{handler: 'iframe', size: {x: 760, y: 480}}" href="<?php echo hikashop_completeLink('checkout&task=printcart',true); ?>">
  <img src="/images/Site/Icones/printer.png" alt="<?php echo JText::_('HIKA_PRINT');?>"/>
</a>

Isn't it here that the squeezebox cod should be inserted ?

Last edit: 10 years 2 months ago by codewarrior.

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

  • Posts: 75861
  • Thank you received: 11845
  • MODERATOR
10 years 2 months ago #46885

That's the code to launch the popup which call the other file I'm talking about. And the other file launch the printing and close itself.

If you just want to add some text to the printout, that's easy. Just edit the file I'm talking about and add your text at the beginning.

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

  • Posts: 190
  • Thank you received: 0
10 years 2 months ago #46890

Sorry to be perseverant, I compared the generated code for the adress profile edition popup and the print cart expected popup.
Headers are begining the same, but in printcart, there is missing :
1) <link rel="stylesheet" href="/media/system/css/modal.css" type="text/css" />
2) <script src="/media/system/js/modal.js" type="text/javascript"></script>
3) a javascript begining that way :
<script type="text/javascript">
window.addEvent('domready', function() {
SqueezeBox.initialize({});
SqueezeBox.assign($$('a.modal'), {
parse: 'rel'
});
});
Obviously, SqueezeBox code is not loaded.

I do not understand how these codes are generating full pages and how their headers are build.
Do you have any clue ?

Thanks Nicolas

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

  • Posts: 75861
  • Thank you received: 11845
  • MODERATOR
10 years 2 months ago #46895

There is no such code in the HTML of the edition popup of addresses. And likewise, the code is not in the printcart popup.

That case should however be on the checkout and on the addresses listing page.

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

  • Posts: 190
  • Thank you received: 0
10 years 2 months ago #46903

Nicolas,
I activated the "Allow users to print invoices in the frontend" option and I have a printer icon for commands.
If I click on it it works perfectly like you describe for the checkout !

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

  • Posts: 75861
  • Thank you received: 11845
  • MODERATOR
10 years 2 months ago #46913

So, is that what you wanted to do ?

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

  • Posts: 190
  • Thank you received: 0
10 years 2 months ago #46992

Yes for the Invoice printing in Commands history in the frontend. The behaviour is perfect and is working.

But my problem is that I would like to have the same behaviour during checkout : Print a simplified Command page.
But instead of having a quick popup self-printed, the browser switchs to a full new white page.
I just want to obtain something like History, but on Views basis, I do not understand how the page are generated,
integrating the Joomla templates elements which are differents in each situations.

PS : my template has a black background, so the white popup is perfect for printing.

I paste the print icon code from address/listing.php in checkout/cart.php
the behaviour working in address/listing.php is displaying a new white page calling Win printing.
I just see that in the non working view, the generated code in the header doesn't include Joomla /media/system/js/modal.js and SqueezeBox initialisation.

What can differ in the way those 2 views are transformed in a Joomla page ???
or how could I modify their headers ?

N.B. : I pasted the print code from checkout/cart.php in address/listing.php and it works perfectly in a popup !!!

Thanks for help !

Last edit: 10 years 2 months ago by codewarrior.

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

  • Posts: 75861
  • Thank you received: 11845
  • MODERATOR
10 years 2 months ago #47074

Then my previous message was what is needed:
www.hikashop.com/forum/2-general-talk-ab...t.html?lang=fr#46872

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

  • Posts: 190
  • Thank you received: 0
10 years 2 months ago #47075

Nicolas,
sorry to insist, but I edited my previous post with additional tests.
Thanks

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

  • Posts: 75861
  • Thank you received: 11845
  • MODERATOR
10 years 2 months ago #47089

I'm lost. I don't understand where you are.
Please post screenshots and code modifications you did, explaining what is wrong and what you want.

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

Time to create page: 0.078 seconds
Powered by Kunena Forum