Output attribute value and text alongside price in Magento - attributes

HI
I am new to Magento and still new to the whole css, php thing. And I have been searching for over a month to find this answer (I am sure it is here some place, but I cannot seem to find it)
I am building a b2b site for a clothing company. Since they are a wholesaler, they do not sell single items, but rather, they sell them in a pack. Depending on the items , some will come in a pack of 2-Small; 2-Medium; 2-Large, other will come in a pack of 1-Small; 2-Medium; 1-Large, and so on.
So far, I set up an attribute called “Package Set”, which describes the kind of pack the customer will be getting when ordering the item, but it only appears in the Additional Information tab, which is not good, because we want that information to stand out. Putting it in the Short Description is an option, but we want to emphasize it more.
So we want to
1. add a text “per pack” right behind the price.
2. add the value of the attribute “Package Set”, right underneath the price, so people will see it clearly, both in the category and product page. It would look some thing like,
“$60 per pack
Package Set: 2-Small; 2-Medium; 2-Large.”
I am using the modern theme
running 1.4.1.1
Thank you

Copy the file "app/code/design/frontend/base/default/template/catalog/product/view/price_clone.phtml" to the directory "app/code/design/frontend/default/modern/template/catalog/product/view/". This is so you are not overwriting the original file.
Open the file for editing. After where you see this:
<?php echo $this->getPriceHtml($_product, false, '_clone') ?>
Add the following:
<?php echo $this->__('per pack') ?>
By using the function $this->__() you are making the text available to be translated easily. It is good practice to do this always.
For the second part now add this bit on the line after:
<p><?php echo $this->__('Package Set %s', $_product->getPackageSet()) ?></p>
Again it is potentially being translated but this time your extra attribute is being inserted where it says %s. The reason for doing this is to make it clearer when using inline translation. The line has been wrapped in a <p> paragraph tag for yet more clarity and to ensure it appears on it's own line, not following on the end of the previous.
I have assumed your attribute has the code "product_set" - which in Magento becomes 'camel case', or getProductSet.
Finally you might want to remove the attribute from Additional Information tab. This is quite simple, go back to the Manage Attributes page in admin, edit your attribute and change "Visible on Product View Page on Front-end" to "No".

Related

Wix Editor: Second vertical menu inside one page

I am really sorry to ask this question which probably has a very straightforward and easy solution, but I was searching like hell and could not find anything... I have some past experience with web design via HTML, but recently I decided to try out Wix Editor.
I am creating a website of a research group, which has a pretty simple design - header (including menu like "research -- people -- open positions -- contact" etc.), main content below, and finally footer (showing only contact details).
Now the problem: when item "people" is clicked in the header menu, I would like the content below to appear like this: on the left side there will be a list of people names divided into few subsections, e.g.: "Postgraduate students" (and below Name #1, Name #2...), and under that "Undergraduate students" (below Name #3, Name #4 etc.). Each name should be a hyperlink, which - when clicked - will show photo and some details about the given person on the right side of that page.
I tried adding new menu (no success), divide the content of the page into two columns, but then I don't know what to do. Of course, I could create the whole content page (including both name list on the left and personal details on the right) manually for each person but then when a new student comes, I will have to update not only the list on the left once (which I would love to) but each list in each of the person's dedicated "complete" pages. Is there any simple way how to implement this?
I hope I managed to describe the problem clearly and did not confuse everything, as I feel totally lost & stupid now. Many thanks for any feedback.

Drupal how to add a search filter to admin content page

I've never used Drupal before (development or managing content). I was asked to extend the admin content page to have a filter and simply don't know enough to get moving quickly.
Can anyone tell me if adding a search by text filter in the admin content area requires code or is there a CMS feature like adding a node for this task.
If code is required, is there something like a hook for this area? Not sure where to start. I will be investigating on my own but pointers to get me oriented to Drupal would help.
By default Drupal provides search mechanism ready to use. But there are also additional module which can improve search experience. You don't need any coding to use that search. You already have search form block ready to use.
Go to Structure -> Blocks and find block called "Search form". Now all you have to do is to put that block in some region and it will appear on front-end. Of course if it's not already styled by your theme it may be needed to put some extra CSS to make it look nice. There are also some template files which you can override and put some your HTML if you need.
There's also template file for search results page (which of course will work out of box also).
You may also need to create new block region if you want to place your form at some specific place, not covered by any existing region defined by your theme (easy thing to do!).
See https://drupal.stackexchange.com/q/30633/101329, the "Admin Views" module lets you configure the search form as you like.

Drupal 7 -- Publishing and Printing Content Based on Search Results

I am currently working on a project which requires content to be published onto a view or page depending on a search result criteria. For example: I search through my content for the word dog and this word appears on 4 of 20 pieces of content. I wish to view all of those items on a page that is not the Search Results page, but rather one that displays all the content found, so I can print each piece of content.
I apologize if this post is awkwardly worded. At this moment it is just an idea and I am trying to get a better picture of how to change publishing based on search results to a certain area.
Thank you for your time -- and if anyone wishes to ask follow up questions, I'd be more than willing to help clarify.
You can use a view with exposed filter. Create a view, create a filter criteria there, then in settings - check "Expose this filter to visitors, to allow them to change it". A user will see a form in a view, wich you can also make separate from a view, by setting "exposed form" to "yes" and putting it in a sepparate block.

Dividing long content to subpages

I need to divide long content to sub-pages.
Rule for dividing: Heading1 (H1)
Cms-system: MODX Evolution
As far as i know, there is nothing in modx to use for this kind of problem.
I probably got to do this manually anyway, but i still would like to know if there is a way to do this in MODX Evo / Revo.
Edit:
I need to do this in MODX; sub-pages got to be actual subpages, and original page becomes to container.
Navigation will be done with wayfinder.
Edit2:
All done.. manually. Question still open, though.
This is not possible out of the box and I don't know of any extra that archieves what you want. You would have to write a plugin that acts everytime you save a resource and split up the content, create/delete sibling resources as needed etc. Sounds like a lot of work for what you want to archieve to me.
I suppose you have a look at the MIGX extra. It provides you with a TV with the possibility to store an indefinite amount of distinct TV content sets. Have a look at the documentation and Mark Hamstra's tutorial (with screenshots) to see how it is done. You should define one MIGX entry to consist of a text field for the <h1> and a rich text field for the content of the "subpage".
Afterwards, you can use form customization to hide the original content field and display your MIGX Tv instead.
I think, this is a much easier way to archieve, what you want, and can't think of any way, where you would benefit from actual subpages.
Edit: Sorry, I just recognized that you were asking about Evolution, not Revolution. My solution would work in Revo, but I don't think there's something like MIGX for Evo. Sorry, my mistake.
not 'out of the box' you will have to run your content through a snippet to parse it into separate divs or something that you can run some javascript on to possibly 'tab' the content.
If you need to show the 'subpages' in your navigation, you will probably have to use the gatResources extra to parse your content ~ which will be very expensive on resource usage.
You can (depending on how you're using the tree) just create actual sub resources under the parent resource, using Ditto or Wayfinder to build navigation for it.
If you can't use the tree like that (though from your description I think you can), you could also set up a number of template variables ("content1", "content2", "content3" etc) and show that with a simple snippet or so.

Movable Type 4: How can I show the last asset?

I know i can use
<mt:EntryAssets lastn="1">
<img src="<$mt:AssetThumbnailURL width="100"$>" />
</mt:EntryAssets>
to show the 'last' asset...how do I show the 'first' or 'oldest' assest?
[I'll point out here that "first" and "oldest" are not necessarily the same question.
You'll see why this is important below. Given the snippet you used, I'm going to assume what you're asking for is first as in position within the entry content. Sorry for length, but this is one of my pet bugs.]
Technically, you can't. That bug(summarized further down if you don't have an Fbz account) has finally been attached to a milestone, so hopefully this won't always be the case.
Practically, reversing the sort order will usually probably output what you expect:
<mt:entryassets limit="1" sort_order="ascend">
...as long as you compose your entries top-to-bottom, and don't later mess with the assets much
The underlying problem is that the current EntryAssets implementation doesn't actually take your content into account. It just loads a list of associated assets and then sorts them by the created_on dates of the assets themselves, not what physical order they appear in or even when they were attached to that particular entry. So as an extreme example, if you insert five images into a post, my snippet above will return the first image, as expected. If you later reverse their order and save, it'll still output that same image, which is now the (ordinal) last one. So, back to what I said at top, you're thinking "first" and MT is always giving you "oldest." And this requires an even further assumption that you're always uploading the assets at time of composition. If one of them was already in the system from say, two years ago, it's going to get returned because it's just older than everything else.
If you're using MT4.3x with the Entry Asset Manager in the sidebar of the composition screen and use it to attach(rather than insert) assets, this is going to get even more complicated, because there's no way to distinguish between assets that were associated with the entry via each manner.
So.
If you absolutely need the returned asset to be predictable, you'll need to actually distinguish it from the group in some way. There's this suggestion to tag the asset with "#first" or something similar. It's not great, but you'll at least know what you're getting(assuming you only tag one asset per entry as such). If you've got custom fields available, you might see if it makes more sense to create a separate "featured/thumbnail image" asset field that it would go into so that you could explicitly test for it. It'll ultimately depend some upon why you're wanting to extract this particular asset.

Resources