In VM2, I can use the template override default_relatedproducts.php
with the following code:
<?php echo $field->display ?>
That outputs the HTML
<a title="x" href="x">
<img alt="" src="x.jpg">
Product Name
</a>
Where can I change the output of $field->display, as it doesnt appear to be in the templating system?
Has anyone any information on modifying the related products output..
I'm new to this forum, so I'm not sure this answer will be what you're looking for. But, because I see you have had no answers since posting your question in May, I'll give it a shot.
There is a non-commercial extension to Joomla called "K2" which supposedly provides a large number of GUI enhancements and customization capabilities.
In addition, the makers of K2 have also created a COMMERCIAL component called K2mart which, I understand, somehow "bridges" Virtuemart and K2, adding enhanced editing and customization capability to Virtuemart functions.
I have yet to use K2 or K2mart, but from their descriptions, they may be what you're looking for - if you haven't already solved your problem.
Related
I'm working on Event websites with Joomla, and the issue is that these websites require that their content be updated quite frequently. There are different types of content, such as Speaker, Partner Companies and a complex Agenda.
I'm looking for a CCK or other extension that will allow me to make custom data types - one each for Speakers, Partners, etc.
For example, the Speakers content type would contain -
Their name
Their company designation
Their photograph
Their Bio
I also need this to be very flexible in its templating, as some things need to be displayed in modals or otherwise.
Thus far, I have found Form2Content to be very helpful, I have also tried K2 and SEBLOD.
I'm wondering if there is a solution better than Form2Content to solve this issue - any help is appreciated. :)
You can try use K2 and extrafields or write own K2 plugin for add some additional specific content type. With template hierarchy create own child k2 template in templates/your_template/html/com_k2/your_new_tmpl/ where could be modals or otherwise.
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
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'm trying to get article's created timestamp or date so I can format it with css. I've searched on google and on the forum but, I'm confused on the result.
I've done this:
echo $this->article->created;
echo $this->item->created;
And is giving me a blank result.
What am I doing wrong?
Looking at the page layout
https://github.com/joomla/joomla-cms/blob/2.5.x/components/com_content/views/article/tmpl/default.php#L114
Line 114 you see how the date is rendered in 2.5.
<dd class="create">
<?php echo JText::sprintf('COM_CONTENT_CREATED_DATE_ON', JHtml::_('date', $this->item->created, JText::_('DATE_FORMAT_LC2'))); ?>
</dd>
So to style it you can just use the create class or you can make a layout override.
This is assuming you want it in an article. If you want it in a list or something look at the appropriate layout for that. And if you want to override the date format itself do that in a layout override.
The element you want seems to vary by version, so make sure whatever you are cribbing off of, matches your installation.
First of All where you are trying to display the created date.
1) In normal article views like default joomla catgory ,blog or any other view.
You should check the following.
The article options that available on the right side options of articles the created date is show true.
Then Also make sure If it assigned to a menu there also these options available there also
make true.
Then you will get the created date in the articles default view.
2)If you are trying with a custom code section you can find some codes like this.
$useDefList = (($params->get('show_author')) OR ($params->get('show_category')) OR ($params->get('show_parent_category'))
OR ($params->get('show_create_date')) OR ($params->get('show_modify_date')) OR ($params->get('show_publish_date'))
OR ($params->get('show_hits')));
on the article default view of joomla.In any version of joomla these should be based on article options values.
Hope this may help you...