Menro
web, seo, email, hack
- Регистрация
- 27 Янв 2008
- Сообщения
- 689
- Реакции
- 138
- Автор темы
- #1
Здравствуйте!
Нужна помощь.
У меня есть вот такой кусок кода:
	
	
	
		
В этом коде есть строка: echo ($productChild->allPrices['0']['salesPrice']); - она выводит цены для товаров и массива productChild и выводит всё так как надо, только единственное, что не в том месте, где мне это нужно.
В самом низу кода есть строка $html .= 'Вот здесь надо вывести'; - вот здесь бы мне как-то вывести данные из этого массива. А как это сделать, не понимаю...в php не шарю, помогите кто чем может, спасибо!
	
		
			
		
		
	
				
			Нужна помощь.
У меня есть вот такой кусок кода:
		PHP:
	
	$parentStock = 0;
                    if($uncatChildren){
                        foreach ($uncatChildren as $k => $child) {
                            /*if(!isset($child[$customfield->customfield_value])){
                                vmdebug('The child has no value at index '.$customfield->customfield_value,$customfield,$child);
                            } else {*/
                            $productChild = $productModel->getProduct((int)$child,true);
               
                            //Вот нужная мне строка
                            echo ($productChild->allPrices['0']['salesPrice']);
                
                            if(!$productChild) continue;
                            if(!isset($productChild->{$customfield->customfield_value})){
                                vmdebug('The child has no value at index '.$child);
                                continue;
                            }
                            $available = $productChild->product_in_stock - $productChild->product_ordered;
                            if(VmConfig::get('stockhandle','none')=='disableit_children' and $available <= 0){
                                continue;
                            }
                            $parentStock += $available;
                            $priceStr = '';
                            if($customfield->wPrice){
                                //$product = $productModel->getProductSingle((int)$child['virtuemart_product_id'],false);
                                $productPrices = $calculator->getProductPrices ($productChild);
                                $priceStr =  ' (' . $currency->priceDisplay ($productPrices['salesPrice']) . ')';
                            }
                            $options[] = array('value' => JRoute::_ ('index.php?option=com_virtuemart&view='.$view.'&virtuemart_category_id=' . $virtuemart_category_id . '&virtuemart_product_id=' . $productChild->virtuemart_product_id,false), 'text' => $productChild->{$customfield->customfield_value}.$priceStr);
                            if($selected==$child){
                                $selectedFound = true;
                                vmdebug($customfield->virtuemart_product_id.' $selectedFound by vRequest '.$selected);
                            }
                            //vmdebug('$child productId ',$child['virtuemart_product_id'],$customfield->customfield_value,$child);
                            //}
                        }
                    }
                    if(!$selectedFound){
                        $pos = array_search($customfield->virtuemart_product_id, $product->allIds);
                        if(isset($product->allIds[$pos-1])){
                            $selected = $product->allIds[$pos-1];
                            //vmdebug($customfield->virtuemart_product_id.' Set selected to - 1 allIds['.($pos-1).'] = '.$selected.' and count '.$dynChilds);
                            //break;
                        } elseif(isset($product->allIds[$pos])){
                            $selected = $product->allIds[$pos];
                            //vmdebug($customfield->virtuemart_product_id.' Set selected to allIds['.$pos.'] = '.$selected.' and count '.$dynChilds);
                        } else {
                            $selected = $customfield->virtuemart_product_id;
                            //vmdebug($customfield->virtuemart_product_id.' Set selected to $customfield->virtuemart_product_id ',$selected,$product->allIds);
                        }
                    }
                    $url = 'index.php?option=com_virtuemart&view='.$view.'&virtuemart_category_id='.
                    $virtuemart_category_id .'&virtuemart_product_id='. $selected;
                    $attribs['option.key.toHtml'] = false;
                    $attribs['id'] = '[';//$idTag;
                    $och = '';
                    if(!empty($attribs['reload'])){
                        $och = ' onchange="window.top.location.href=this.options[this.selectedIndex].value" reload=1';
                        unset($attribs['reload']);
                    } else {
                        $och = ' data-dynamic-update="1"';
                        unset($attribs['data-dynamic-update']);
                    }
                    $attribs['list.attr'] = 'size="1" class="vm-chzn-select no-vm-bind avselection"'.$och;
                    $attribs['list.translate'] = false;
                    $attribs['option.key'] = 'value';
                    $attribs['option.text'] = 'text';
                    $attribs['list.select'] = JRoute::_ ($url,false);
                    $idTagK = '[';
                    $html .= JHtml::_ ('select.genericlist', $options, $fieldname, $attribs);
                    $html .= 'Вот здесь надо вывести';В этом коде есть строка: echo ($productChild->allPrices['0']['salesPrice']); - она выводит цены для товаров и массива productChild и выводит всё так как надо, только единственное, что не в том месте, где мне это нужно.
В самом низу кода есть строка $html .= 'Вот здесь надо вывести'; - вот здесь бы мне как-то вывести данные из этого массива. А как это сделать, не понимаю...в php не шарю, помогите кто чем может, спасибо!
 
				 
 
		