Magento simple product attributes - $_item acting weird - mysql

I've been working on a magento site, and was able to pull the simple product attributes with this:
$_item->getAttributename()
This is on grouped.phtml template since I'm pulling those attributes to the table of a Grouped Product.
It was working fine until some days ago, it just stopped working. It's only showing the Sku and the Price of the simple product. Not displaying the other attributes (like capacity, etc).
I've been messing around with:
<?php print('<pre>');print_r($_item->getData());print('</pre>'); ?>
And found out that in my local copy it displays the attributes in the array of $_item, but it's not showing them online and that must be why I can't pull them with getAttributename.
My question is, why would the $_item just change like that? And how can I fix this?
Thank you!

Related

Squarespace Custom Product Post Type

I was thinking about creating different templates for products (not with different features but with different html organization and css) because the standard "pic on the left and data on the right" is not enough for a well-made user-centered ecommerce.
I tried the custom post types but they are blog post and can't access the product data.
in my custom product.conf i added my custom post data
"acceptTypes" : ["store_item", "custom-product-item"]
but obv. it won't work.
maybe if I could access the store_item could be easier to do this, but i can't find on the repo.
anyone has some suggestion?
Unfortunately, although it used to be possible to create custom post type products, that stopped being possible within the last year or so.
If you want to create your own template for products, you need to override the products.list and/or products.item files with your own. By placing them within your /collections folder, it will override the system default ones.
That means you have to write it entirely from scratch. Here are a couple resources that may help (despite being outdated):
http://www.bcarroll.us/developer-platform-tutorials/2014/10/20/products-pages
https://answers.squarespace.com/questions/57343/productsitem-for-adirondack-template.html
Having overridden products.item, if you want to have different templates for different products, you can do something like:
{.equal? item.urlId "myurlid1"}
{#|apply products1.block}
{.or equal? item.urlId "myurlid2"}
{#|apply products2.block}
{.or}
etc.

HTML in WooCommerce product-attributes

I'm looking for a way to allow Woocommerce to work with html within product attributes, so that for instance an attrbitue like PDF can link to a URL of a PDF.
Sample of the content of this attribute would be:
[ a target ="_blank"href="http://dmpscores.s3.amazonaws.com/pdf/ckh-20/ckh-20.pdf">PDF ]
This is not possible now. I know there are workarounds to put this attribute in another tab, but than there is the problem of batch-import of - in this case - 5000 products and not being able to import it to the right tab.
I think it is a serious issue that WooCommerce doesn't allow html in product attributes. This would make the plugin much more better.
Who has a solution for this problem?

Shopp Catalog Shortcodes on Wordpress

I'm using Shopp on a Worpress site, and would like to pass two slugs in one shortcode instead of two shortcodes.
Right now, this is how it's displayed:
[catalog-collection slug="holiday-gift-cards"]
[catalog-collection slug="holiday-platters"]
Is there a way to get both of those into one shortcode? I'd like to display them that way so they come in after one another instead of breaking into a different row on top of each other.
I can't find any syntax online of how to do it, so if anyone knows how, any help is appreciated! Thanks.
Since the comment turned out to be an answer, I'll repost here for future reference in case others might have the same question:
If you're going to use Shortcodes for this, the Shopp Shortcode Documentation has a slug called 'tag'. If you apply a tag name of 'holiday' to all of the products you want to combine, you can have a shortcode of just [catalog-collection slug="tag" tag="holiday"]

Magento: Where is this "$_formatedOptionValue" being created?

If, in magento you have a bundled product, and you have a few product options for it. On the shopping cart page, on the checkout page, and in other places, these options will be displayed using this code:
<?php echo $_formatedOptionValue['full_view'] ?
This code can be found in many places, for example in */app/design/frontend/base/default/template/downloadable/checkout/cart/item/default.phtml *
about line 43
Anybody knows where can I get the behind of this code "formatedOptionValue". I want to modify a bit the way the product options are being displayed and constructed. Please, if you know, can you point out the direction of where this function is being constructed?
Usually $_formatedOptionValue will be assigned within the same template file where it's used.
In standard Magento this assigment will be done by calling $this->getFormatedOptionValue(), which in turn mostly maps to one of these two methods:
Mage_Checkout_Block_Cart_Item_Renderer::getFormatedOptionValue()
Mage_Sales_Block_Order_Item_Renderer_Default::getFormatedOptionValue()

URL Masking in .Net / HTML

I have a website in which I have many categories, many sub-categories within each one and many products within each of those. Since the URLs are very user-unfriendly (they contain a GUID!!!), I would like to use a method which I think is called URL Masking. For example instead of going to catalogue.aspx?ItemID=12343435323434243534, they would go to notpads.htm. This would display the same as going to catalogue.aspx?ItemID=12343435323434243534 would display, somehow.
I know I could do this by creating a file for each category / sub-category (individual products cannot be accessed individually as it is a wholesale site - customers cannot purchase directly from the site). This would be a lot of work as the server would have to update each relevant file whenever a category / sub-category / product visibility changes, or a description changes, a name changes... you get the idea...
I have tried using server-side includes but that doesn't like it when a .aspx file is specified in an html file.
I have also tried using an iframe set to 100% width / height and absolutely positioned left 0 and top 0. This works quite well, but I know there are reasons you should not use this method such as some search engines not coping with it well. I also notice that the title of the "parent" page (notepads.htm) is not the title set in the iframe (logically this is correct - but another issue I need to solve if I go ahead and use this method).
Can anyone suggest another way I could do this, or tell me whether I am going along the right lines by using iframes? Thanks.
Regards,
Richard
PS If this is the wrong name for what I am trying to do then please let me know what it actually is so I can rename / retag it.
Look into URL Rewrites. You can create a regular expression and map it to your true url. For example
http://mysite.com?product=banana
could map to
http://mysite.com?guid=lakjdsflkajkfj3lj3l4923892&asfd=9234983920894893
I believe you mean URL Rewriting.
IIS 7+ has a rewrite module built in that you can use for this kind of thing.
URL Rewriters solve the problem you are describing - When someone requests page A, display page B - in a general way.
But yours is not a general requirement. You seem to have a finite uuid-to-shortname mapping requirement. This is the kind of thing you could or should set up in your app, yourself, rather than inserting a new piece of machinery into your system.
Within a default .aspx page, You'd simply do a lookup on the shortname from the url in a persistent table stored somewhere, and then call Server.Transfer() to the uuid-named page associated to that shortname.
It should be easy to prototype this.