I have recently been having problems with Magento's one page checkout system.
At the moment it is working in a basic way, but the progress steps which are normally displayed on the right hand side are not being updated when the steps are completed. The step headings are showing up (Billing Address, Shipping Address, etc.), and I can control their styles through the boxes.css settings, but they don't get filled in with the content as the customer step through the process.
I have tried a number of solutions, including:
changing the xml and
tweaking the opchecout.js file
What is the best way to debug something like this?
check that the ID of the block you insert matches the ID that is refreshed by the JavaScript function. I had that problem. If you are using the base/default/js/opcheckout.js file, it should be
id='checkout-progress-wrapper'
like so (in your onepage.phtml template):
<div id="checkout-progress-wrapper">
<?php echo $this->getChildHtml('checkoutProgress') ?>
</div>
Best if you check the js file also
Related
So, I started on a new project this week and of course I'm thinking about the problems I'm going to find during the whole development process. We are going to make a shop that has a pretty good design, pretty excited to work on this. However, the design uses a lot of content that can't be placed in the normal functions of magento. For example there is a catalog page that has a lot of content blocks with secondary information like unique selling points or a bit of story telling. This can and will be different for different categories. We are talking about a lot of small content blocks, not something you can cram into the category description field ;)
Until now I mostly used static blocks to make this content and show them on the pages, maybe even use xpath to extract the information I need from the blocks to prevent the end-user from destroying the design by using the WYSIWYG editor. However, I don't think this will be a good solution now because there will simply be to much static blocks to create and use without loosing the overview of everything, plus I doubt xpath is really good performance wise (something like getting a screw in with a hammer).
I was thinking about making a module or using a module that makes it possible to add attributes and use attribute sets in combination with static blocks. With that you can make your own fields and groups for certain pages and make it easy for the end-user to edit information on their webshop. However, making this myself (does sound like a lot of fun) will take to much time, and I can't really find a module that does something like this.
How do you guys solve these problems when creating a new webshop? Any tips?
I suppose you will be using your own theme with own template for the category page, here you will setup all the HTML that you don't want the admin to mess up with the WYSIWYG editor and let them change only certain parts of the page. For the admin to be able to edit these, you will need to add new attributes to the category entity. For example if the admin should add text for a certain box, add text type of attribute, if the admin wants to add HTML create WYSIWYG editor type of attribute and so on. Then in your template you will check if the category has any of these attributes and they have non-empty values then print them.
For example:
<?php if ($category->getCustomTextAttribute() != ''): ?>
<div id="your-div">
<?php echo $category->getCustomTextAttribute(); ?>
</div>
<?php endif; ?>
<?php if ($category->getPromotionHtml() != ''): ?>
<div id="promotion-div">
<?php echo $category->getPromotionHtml(); ?>
</div>
<?php endif; ?>
This goes the same for the product pages with the difference that for products you can create the attributes via the admin and then print them on the product page template, otherwise for Categories you need to write a module that does this, if you want me I can provide you with an example of module for creating Category attributes.
I ended up using a combination of zokibtmkd answer and adding fields to the default static blocks (a image upload function and a link field). The combination of these two solutions gave me enough to work with in the design without messing up the admin or the templates.
I learned how to edit Invoice PDF, Shipping PDF, Credit Memo PDF.
I was not able to find out where are the files responsabile of Order PDF, the one that downloads when you are in the order View page and press print.
Please, if anyone know, help me to find the files which are responsable for Order PDF.
The transactional email responsible for the order, invoice, shipment etc. attachments can be located under the locale directory:
app/locale/{lang}/templates/email/sales/
Lang will be your default language, like en_US, en_GB etc.
The files responsible are:
order_new.html
order_new_guest.html
Edit as per comments:
I believe what you're looking for can be found over here:
app/design/frontend/{your_theme}/default/templates/sales/order/items/renderer/default.phtml
Please note though that changes you make here will also appear on the order view page.
To avoid this, you can use the following condition in this phtml (there is also an example in the original version):
<?php if ($this->getPrintStatus()): ?>
....
<?php endif;?>
.. and for similar issues in the future: on the admin panel, in System/Configuration menu if you switch to "Store view", you will find an option under Advanced/Developer tab called "Template path hints". If you set it to "yes", you will see the template pathes in the frontend, embedded inline next to each block. How to use template path hints
So we have a section on our website (category menu) which was modified to include a custom menu system. in the file top.phtml i found the following code
<div >
<?php //echo $_menu;
echo $nf_menu;
?>
</div>
The code inside the div's is calling for the menu, but i need to edit the actual code of the menu as it has inline styles for z-index applied to it and i need to adjust the z-index number.
Where would i find this menu. does that php code indicate where the file may be? Our coder is gone so we are not sure how they did this.
Based on the very limited information you've provided, there are basic ways of finding out where specific code is being generated in Magento (or any other scripting/php based framework).
View the html source (output) of your menu in a browser and find a piece of the menu HTML that would be unique. An example can be a unique class name or something that will set it apart from everything else.
<ul class="nf-menu">
<li>...
Do a site-wide file search for the unique reference you found in step 1. For example, search for <ul class="nf-menu"> or just nf-menu.
Don't know how to search for text in a file? Use the resources you have available to learn how:
For Linux based machines, see Finding all files containing a text string on Linux
Or if you have the files locally, use an IDE program such as phpStorm or Dreamweaver that includes a folder search for files containing a string of text.
Once you've found the file generating the code, simply make the modifications. I'd recommend making a backup of any file you modify so that you can revert to it if you're changes don't work as intended.
Im trying to add pm2 (per meter squared) next to the price on the product page in magento, here is an example:
after looking at the souce code for how they showed this it was:
<span class="metres">m<sup>2</sup>
so I added that little bit of code to my theme template in magento file location (app/design/frontend/default/THEMENAME/template/catalog/product/view/price.phtml):
<div class="price-box" id="product_price">
<p class="old-price"><?php echo $this->__('Old Price:') ?><?php echo $this->getPrice() ?></p>
<p class="special-price"><?php echo $this->getPrice() ?><span class="metres">m<sup>2</sup></p>
</div>
but nothing shows up, see example:
any ideas on how to achieve this ?
As an alternative approach you could try the :afer pseudo element (see http://css-tricks.com/almanac/selectors/a/after-and-before/). I don't like modifying core files (even if you do take a copy in your theme like you have) because a future upgrade may change the file significantly and your version might even become incompatible. This approach at least would avoid that.
And to get your superscripted 2, see CSS :before superscript "6"?.
if you look at price.phtml you will see there are many repetitions of price and special price, as the file is used to cover every possible price permutation - product type and tax display etc. Step through each price echo and add [WHAT EVER] to the output until you find the code being fired for your particular instance and then add the m2 code to it.
EDIT: Looks like you are editing the wrong file. You should edit template/catalog/product/price.html, not template/catalog/product/view/price.phtml. You can see from your screen grab and your code they are not the same. Your code is echo'ing 'old price' which doesnt appear.
I just want to add a label that says "*Residential Addresses May Incur Additional Charges" somewhere in the shipping methods portion of onepage checkout.
I can't find where any of it is stored, my only clue is getChildHtml('additional'), which seems to be where it's all generated from.
I need to add this until I can figure out how to put a residential checkbox on the address page for fedex/ups quotes.
Anyone have any idea, because this should really be simple, but it's incredibly complicated
I mean I'm thinking of just making a jQuery block that'll append the label somewhere on pageload since I can't seem to find where this html is stored :/
I finally figured it out, even though it's not ideal...
in the shipping_method.phtml file, you need to find this line of code:<div id="onepage-checkout-shipping-method-additional-load">
<?php echo $this->getChildHtml('additional') ?>
</div>
Then you can insert a or whatever before it and it will show up beneath everything.
Why must they make this so hard...