| View previous topic :: View next topic |
| Author |
Message |
fraternitee
Joined: 14 Oct 2011 Posts: 14
|
Posted: Fri Nov 25, 2011 6:50 pm Post subject: Magento Product attribute in Items by Quantity |
|
|
| Is it possible to pull a custom attribute from my magento store and use that attribute in the Items by Quantity. I am basically wanting to build a pick list that would allow me to quickly pull the style and sizes i need. |
|
| Back to top |
|
Brett Berger Site Admin
Joined: 11 Jun 2010 Posts: 2398
|
Posted: Fri Nov 25, 2011 7:44 pm Post subject: |
|
|
I believe the answer is yes but the setup is beyond my expertise, since I've never actually tried it myself. I see in our release notes that in v3.1.4.2988 (released 07/06/2011) there is a line that reads "Magento - Added examples to the module for how to include custom product attributes."
Take a look at the latest ShipWorks Magento Module File (shipworks3.php http://www.interapptive.com/shipworks/downloadcustomer.php?file=magento), edit the .php and find this code..
// Uncomment the following lines to include a custom product attribute in the downloaded data.
// These will appear as Order Item Attributes in ShipWorks.
//$product = Mage::getModel('catalog/product');
//$productId = $product->getIdBySku($sku);
//$product->load($productId);
//$value = $product->getAttributeText("attribute_code_here");
//if ($value)
//{
// // write the gift message as an attribute
// writeStartTag("Attribute");
// writeElement("Name", "Attribute_title_here");
// writeelement("Value", $value);
// writeCloseTag("Attribute");
//}
Hopefully that will get you started. Once you get them downloading successfully into ShipWorks then we would move on to "phase 2" which would be to add them to the desired templates/reports. _________________ Brett Berger
Interapptive ShipWorks Support |
|
| Back to top |
|
fraternitee
Joined: 14 Oct 2011 Posts: 14
|
Posted: Fri Nov 25, 2011 8:13 pm Post subject: |
|
|
K looks to be all done.
I see my two attributes in the order items window.
now i have this block in my template.
| Code: |
<tr>
<xsl:if test="$showThumbnails">
<td style="width: 50px; {$orderDetailHeaderStyle};">Image</td>
</xsl:if>
<td style="{$orderDetailHeaderStyle}; white-space: nowrap;">Item Code</td>
<td style="{$orderDetailHeaderStyle}; ">Name</td>
<td style="{$orderDetailHeaderStyle}; ">Style</td>
<td style="{$orderDetailHeaderStyle}; ">Size</td>
<td style="{$orderDetailHeaderStyle};" align="right">Quantity</td>
<td style="{$orderDetailHeaderStyle};" align="right">Total</td>
</tr>
|
...
| Code: | <td style="{$orderDetailContentStyle}; white-space: nowrap;"><xsl:value-of select="Code" /></td>
<td style="{$orderDetailContentStyle};"><xsl:value-of select="Name" /></td>
<td style="{$orderDetailContentStyle};"><xsl:value-of select="Style" /></td>
<td style="{$orderDetailContentStyle};"><xsl:value-of select="Size" /></td>
<td style="{$orderDetailContentStyle};" align="right"><xsl:value-of select="$groupQuantity" /></td>
<td style="{$orderDetailContentStyle};" align="right">$<xsl:value-of select="format-number($groupTotal, '#,##0.00')" /></td>
|
|
|
| Back to top |
|
Brett Berger Site Admin
Joined: 11 Jun 2010 Posts: 2398
|
Posted: Sat Nov 26, 2011 7:01 am Post subject: |
|
|
The next question would be to figure out how to uniquely identify each item attribute. I'm assuming (hoping) that there will be an XML attribute that will help; so that we don't have to parse the text, say with a sub-string before and look for "Sytle:" or a sub-string after command looking for "Size:" etc. If we have to parse it, becomes significantly more complex, typically speaking.
Reply back with some XML Source code from ShipWorks so I can get an idea of how your data comes down from Magento in this case.
Highlight an order or two that have item attribute details > click Output > Save and Open > choose (all the way at the bottom) System\XML Source report > copy and paste the item details here in a reply so we can take a look. _________________ Brett Berger
Interapptive ShipWorks Support |
|
| Back to top |
|
dustyabe
Joined: 22 Feb 2012 Posts: 1
|
Posted: Wed Feb 22, 2012 9:19 pm Post subject: |
|
|
fraternitee,
I am currently trying to implement a new attribute into shipworks but I am having issues getting the code within the shipworks3.php file setup correctly. Can you please post an example of the actual code created? _________________ Dustyabe |
|
| Back to top |
|
|