Я новичок в Magento. Мы создали настраиваемую опцию. Но всякий раз, когда мы выбираем «радиальный», он всегда отображает параметр «Нет», который нам нужно удалить. Я из того, что понимаю, это вытаскивает какой-то код из Magento Core.Удалить пользовательскую опцию «Нет»
Это HTML, что мне нужно изменить:
<dt><label>Add a Display Case:</label></dt>
<dd class="last">
<div class="input-box">
<ul id="options-7-list" class="options-list"><li><input type="radio" id="options_7" class="radio product-custom-option" name="options[7]" onclick="opConfig.reloadPrice()" value="" checked="checked" /><span class="label"><label for="options_7">None</label></span></li><li><input type="radio" class="radio product-custom-option" onclick="opConfig.reloadPrice()" name="options[7]" id="options_7_2" value="19" price="45" /><span class="label"><label for="options_7_2">Acrylic Cube <span class="price-notice">+<span class="price">$45.00</span></span></label></span></li><li><input type="radio" class="radio product-custom-option" onclick="opConfig.reloadPrice()" name="options[7]" id="options_7_3" value="20" price="75" /><span class="label"><label for="options_7_3">Lucite Case <span class="price-notice">+<span class="price">$75.00</span></span></label></span></li></ul> </div>
</dd>
Это где я думаю, что он выводит ....
<?php
class OptionExtended_Block_Product_View_Js extends Mage_Catalog_Block_Product_View_Options
{
protected $config = array();
protected $thumbnailDirUrl = '';
protected $pickerImageDirUrl = '';
protected function _construct()
{
$children = array();
$sd = array();
$configValues = array();
$inPreConfigured = $this->getProduct()->hasPreconfiguredValues();
$storeId = Mage::app()->getStore()->getId();
$product_id = $this->getProduct()->getId();
$filter = Mage::getModel('core/email_template_filter');
$options = $this->getProduct()->getOptions();
foreach ($options as $option){
if (!is_null($option->getLayout())){
$id = (int) $option->getOptionId();
if (!is_null($option->getRowId()))
$option_id_by_row_id[$option->getTemplateId()][(int) $option->getRowId()] = $id;
$this->config[0][$id][0] = $option->getNote() != '' ? $filter->filter($option->getNote()) : '';
$this->config[0][$id][1] = $option->getLayout();
$this->config[0][$id][2] = (int) $option->getPopup();
if ($inPreConfigured){
$configValues[$id] = array();
if (is_null($option->getRowId())){
$configValue = $this->getProduct()->getPreconfiguredValues()->getData('options/' . $id);
if (!is_null($configValue))
$configValues[$id] = (array) $configValue;
}
} else {
$sd[$option->getTemplateId()][$id] = explode(',', $option->getSelectedByDefault());
}
if (!is_null($option->getValues())){
foreach ($option->getValues() as $value) {
$valueId = (int) $value->getOptionTypeId();
$this->prepareImages($value->getImage());
$rowId = (int) $value->getRowId();
$valueId_by_row_id[$value->getTemplateId()][$rowId] = $valueId;
$children[$value->getTemplateId()][$valueId] = explode(',', $value->getChildren());
$this->config[1][$valueId][0] = $value->getImage();
$this->config[1][$valueId][1] = $value->getDescription() != '' ? $filter->filter($value->getDescription()) : '';
$this->config[1][$valueId][2] = array();
$this->config[1][$valueId][3] = array();
}
}
}
}
$options = Mage::getModel('optionextended/option')
->getCollection()
->joinNotes($storeId)
->addFieldToFilter('product_id', $product_id);
foreach ($options as $option){
$id = (int) $option->getOptionId();
if (!is_null($option->getRowId()))
$option_id_by_row_id['orig'][(int) $option->getRowId()] = $id;
$this->config[0][$id][0] = $option->getNote() != '' ? $filter->filter($option->getNote()) : '';
$this->config[0][$id][1] = $option->getLayout();
$this->config[0][$id][2] = (int) $option->getPopup();
if ($inPreConfigured){
$configValues[$id] = array();
if (is_null($option->getRowId())){
$configValue = $this->getProduct()->getPreconfiguredValues()->getData('options/' . $id);
if (!is_null($configValue))
$configValues[$id] = (array) $configValue;
}
} else {
$sd['orig'][$id] = explode(',', $option->getSelectedByDefault());
}
}
$values = Mage::getModel('optionextended/value')
->getCollection()
->joinDescriptions($storeId)
->addFieldToFilter('product_id', $product_id);
foreach ($values as $value) {
$valueId = (int) $value->getOptionTypeId();
$this->prepareImages($value->getImage());
$rowId = (int) $value->getRowId();
$valueId_by_row_id['orig'][$rowId] = $valueId;
$children['orig'][$valueId] = explode(',', $value->getChildren());
$this->config[1][$valueId][0] = $value->getImage();
$this->config[1][$valueId][1] = $value->getDescription() != '' ? $filter->filter($value->getDescription()) : '';
$this->config[1][$valueId][2] = array();
$this->config[1][$valueId][3] = array();
}
if ($inPreConfigured){
foreach ($configValues as $optionId => $v){
$this->config[0][$optionId][3] = array();
foreach($v as $valueId)
$this->config[0][$optionId][3][] = (int) $valueId;
}
} else {
foreach ($sd as $templateId => $v){
foreach ($v as $optionId => $vv){
$this->config[0][$optionId][3] = array();
foreach($vv as $rowId)
if ($rowId != '')
$this->config[0][$optionId][3][] = $valueId_by_row_id[$templateId][(int)$rowId];
}
}
}
foreach ($children as $templateId => $v){
foreach ($v as $valueId => $vv){
foreach ($vv as $rowId){
if ($rowId != ''){
if (isset($option_id_by_row_id[$templateId][(int)$rowId]))
$this->config[1][$valueId][2][] = $option_id_by_row_id[$templateId][(int)$rowId];
else
$this->config[1][$valueId][3][] = $valueId_by_row_id[$templateId][(int)$rowId];
}
}
}
}
}
public function getConfig()
{
return Zend_Json::encode($this->config);
}
public function prepareImages($image)
{
if ($image){
$thumbnailUrl = $this->makeThumbnail($image);
$pickerImageUrl = $this->makePickerImage($image);
if ($this->thumbnailDirUrl == ''){
$this->thumbnailDirUrl = str_replace($image, '', $thumbnailUrl);
$this->pickerImageDirUrl = str_replace($image, '', $pickerImageUrl);
}
}
}
public function makeThumbnail($image)
{
$thumbnailUrl = $this->helper('catalog/image')
->init($this->getProduct(), 'thumbnail', $image)
->keepFrame(true)
// Uncomment the following line to set Thumbnail RGB Background Color:
// ->backgroundColor(array(246,246,246))
// Set Thumbnail Size:
->resize(100,100)
->__toString();
return $thumbnailUrl;
}
public function makePickerImage($image)
{
$pickerImageUrl = $this->helper('catalog/image')
->init($this->getProduct(), 'thumbnail', $image)
->keepFrame(false)
->resize(30,30)
->__toString();
return $pickerImageUrl;
}
public function getThumbnailDirUrl()
{
return $this->thumbnailDirUrl;
}
public function getPickerImageDirUrl()
{
return $this->pickerImageDirUrl;
}
public function getPlaceholderUrl()
{
return Mage::getDesign()->getSkinUrl($this->helper('catalog/image')->init($this->getProduct(), 'small_image')->getPlaceholder());
}
public function getProductBaseMediaUrl()
{
return Mage::getSingleton('catalog/product_media_config')->getBaseMediaUrl();
}
public function getInPreconfigured()
{
return $this->getProduct()->hasPreconfiguredValues() ? 'true' : 'false';
}
}
I У меня все еще проблема. Этот код не был разработан мной, и я пытаюсь устранить проблемы. http://dev.hollywoodcollectibles.com/bill-russell-and-wilt-chamberlain-autographed-indoor-outdoor-basketball.html [ScreenShot] (http://demo.gunshowtrader.com/media/Screen -Shot-2014-10-08-at-2.06.48-PM.png) Здесь он отображает 2 варианта, а также «Нет» перед ним. –
Вы используете какой-то пользовательский модуль. Я предлагаю вам сравнить основной код Magento с кодом модуля и посмотреть, где этот параметр «hardcodes» этого модуля отсутствует. Если вы купили этот модуль, я предлагаю вам обратиться в службу поддержки. – karantan
Это была моя первоначальная мысль. Я просматриваю каждый файл индивидуально, выполняя поиск чего-либо, что может быть связано, и ни одна из них не складывается. Он должен быть на выходе где-то, потому что он не добавляет его в базу данных. –