Bug #1678
Chosen attributes not displayed in basket
| Status: | Resolved | Start date: | 2008-10-11 | |
|---|---|---|---|---|
| Priority: | Must have | Due date: | ||
| Assignee: | Ingo Schmitt | % Done: | 100% |
|
| Category: | Bug | Spent time: | - | |
| Target version: | 0.10.1 | |||
| Votes: | 0 |
Description
The chosen attributes are not displayed in basket.
Associated revisions
Chosen attributes not displayed in basket [fixes #1678]
Chosen attributes not displayed in basket [fixes #1678]
History
Updated by Sascha Egerer over 4 years ago
- File patch_1678.diff added
Updated by Sascha Egerer over 4 years ago
- File deleted (
patch_1678.diff)
Updated by Janine over 4 years ago
Sascha Egerer wrote:
The chosen attributes are not displayed in basket.
I have done the .diff in my php-file and added a new Marker in my template like this:
<h3>PRODUCT_BASKET_FORM_SMALL</h3>
<br />
<!-- ###PRODUCT_BASKET_FORM_SMALL### end -->
<td>###SELECT_ATTRIBUTES_VALUE###</td>
<td align="right">###BASKET_ITEM_PRICEGROSS###</td>
.........
<!-- ###PRODUCT_BASKET_FORM_SMALL### end -->
but my attributes (there are more than one) are still not displayed!?
Updated by Sascha Egerer over 4 years ago
Try this marker ###ARTICLE_SELECT_ATTRIBUTES### instead of ###SELECT_ATTRIBUTES_VALUE###
Updated by Janine over 4 years ago
No sorry - the output doesn't work!
This is my php-code after your diff:
/**
* Genrates the Basket Forms per line
* @param object $art: Article Object
* @param object $prod: Product Object
* @return string HTML-Content
* @Since added $prod for gettingSelectAttributes for Article
*/
function makeArticleView(&$art,$prod=''){
// Getting the select Attributes for displaying
if(is_object($prod)){
$attributeArray = $prod->get_Atrribute_Matrix(array($art->get_uid()),$this->select_attributes);
if(is_array($attributeArray)) {
$attCode = '';
$templateAttr = $this->cObj->getSubpart($this->templateCode, '###BASKET_SELECT_ATTRIBUTES###');
foreach($attributeArray as $attribute_uid => $myAttribute) {
$attributeObj = new tx_commerce_attribute($attribute_uid,$GLOBALS['TSFE']->tmpl->setup['config.']['sys_language_uid']);
$attributeObj->load_data();
$markerArray["###SELECT_ATTRIBUTES_TITLE###"] = $myAttribute['title'];
list($k,$v) = each($myAttribute['values']);
$markerArray["###SELECT_ATTRIBUTES_VALUE###"] = $v['value'];
$markerArray["###SELECT_ATTRIBUTES_UNIT###"] = $myAttribute['unit'];
$attCode .= $this->cObj->substituteMarkerArrayCached($templateAttr, $markerArray , array());
}
}
}
#$markerArray = $art->getMarkerArray($this->cObj,$conf,'article_');
#debug($markerArray,'article_infos');
$markerArray['###ARTICLE_SELECT_ATTRIBUTES###'] =$attCode;
$markerArray['###ARTICLE_UID###']= $art->getUid();
$markerArray['###STARTFRM###'] = '<form name="basket_'.$art->uid.'" action="'.$this->pi_getPageLink($this->conf['basketPid']).'" method="post">';
$markerArray['###HIDDENFIELDS###'] = '<input type="hidden" name="'.$this->prefixId.'[catUid]" value="'.$this->piVars[catUid].'" />';
$markerArray['###HIDDENFIELDS###'] .= '<input type="hidden" name="'.$this->prefixId.'[artAddUid]['.$art->uid.'][price_id]" value="'.$this->basket->basket_items[$art->uid]->get_price_uid().'" />';
$markerArray['###ARTICLE_HIDDENFIELDS###'] = '<input type="hidden" name="'.$this->prefixId.'[catUid]" value="'.$this->piVars[catUid].'" />';
$markerArray['###ARTICLE_HIDDENFIELDS###'] .='<input type="hidden" name="'.$this->prefixId.'[artAddUid]['.$art->uid.'][price_id]" value="'.$this->basket->basket_items[$art->uid]->get_price_uid().'" />';
$markerArray['###QTY_INPUT_VALUE###'] = $this->basket->basket_items[$art->uid]->quantity;
$markerArray['###QTY_INPUT_NAME###'] = $this->prefixId.'[artAddUid]['.$art->uid.'][count]';
$markerArray['###BASKET_ITEM_PRICENET###'] = tx_moneylib::format($this->basket->basket_items[$art->uid]->get_price_net(),$this->currency);
$markerArray['###BASKET_ITEM_PRICEGROSS###'] = tx_moneylib::format($this->basket->basket_items[$art->uid]->get_price_gross(),$this->currency);
$markerArray['###BASKET_ITEM_PRICENETNOSCALE###'] = tx_moneylib::format($this->basket->basket_items[$art->uid]->getNoScalePriceNet(),$this->currency);
$markerArray['###BASKET_ITEM_PRICEGROSSNOSCALE###'] = tx_moneylib::format($this->basket->basket_items[$art->uid]->getNoScalePriceGross(),$this->currency);
$markerArray['###BASKET_ITEM_COUNT###'] = $this->basket->basket_items[$art->uid]->get_quantity();
$markerArray['###BASKET_ITEM_PRICESUM_NET###'] = tx_moneylib::format($this->basket->basket_items[$art->uid]->get_item_sum_net(),$this->currency);
$markerArray['###BASKET_ITEM_PRICESUM_GROSS###'] = tx_moneylib::format($this->basket->basket_items[$art->uid]->get_item_sum_gross(),$this->currency);
Maybe there is a bug?
Updated by Sascha Egerer over 4 years ago
Janine wrote:
No sorry - the output doesn't work! This is my php-code after your diff: [...]
Maybe there is a bug?
Is there any output for the attributes?
Does the subpart ###BASKET_SELECT_ATTRIBUTES### exist in your template file?
What is the value of $attCode after the foreach loop?
Updated by Ingo Schmitt over 4 years ago
- Target version set to 0.10.1
Updated by Sascha Egerer over 4 years ago
- File patch_1678.diff added
- Assignee set to Ingo Schmitt
Can you please apply this patch? I've added a patch against current trunk.
Updated by Morten Haggren about 4 years ago
Sascha Egerer wrote:
Can you please apply this patch? I've added a patch against current trunk.
Considering that this bug makes the basket useless for shops with variant products this should be added to the trunk
Updated by Sascha Egerer almost 4 years ago
- Status changed from Accepted to Resolved
- % Done changed from 0 to 100
Applied in changeset r21637.