我有一些代码位于 Magento 旁边的文件夹中。我要过来Mage.php做点事情。我希望能够在我的代码中获取某种运输报价。我一直在网上浏览,我正在努力寻找任何合理的地方。
请有人告诉我实现这一目标的最有效方法?
\n\n我只有以下信息可用于获取费率:
\n\nProduct ID eg, 123\nQuantity eg, 1020\nCountry Code eg, GB\nZip code if needed eg, SY12 6AX\nRun Code Online (Sandbox Code Playgroud)\n\n我想得到以下信息:
\n\nRate eg, \xc2\xa32.50\nTitle eg, Royal Mail Special Delivery\nID eg, 6\nRun Code Online (Sandbox Code Playgroud)\n\n然后,我想用我的代码中的选项填充单选列表,以便可以选择它们。
\n\n非常感谢
\n在magento中使用平面目录选项时,为什么magento有以下表格:
flat_catalog_product_1
flat_catalog_product_2
flat_catalog_product_3
Run Code Online (Sandbox Code Playgroud)
为什么不只是一张单桌?
在 Magento 中你可以找到类似的结构
$select->joinLeft(
array('c' => $couponTable),
'c.customer_id=root.entity_id AND c.rule_id=:rule_id',
array('c.coupon_id')
);
Run Code Online (Sandbox Code Playgroud)
二元运算符=:的作用是什么?
在我的 Magento 模块中,我以编程方式创建订单。此过程在后台运行,因此在此过程中不可能与客户交互。我想使用 Magento 的采购订单付款方式,如何以编程方式插入采购订单号?不知道我的大脑是否停止工作,但我似乎找不到添加该数字的方法。带有付款方式的代码的唯一部分是这样的:
$shippingAddress->setPaymentMethod($paymentMethod);
$quote->getPayment()->importData( array('method' => $paymentMethod));
Run Code Online (Sandbox Code Playgroud)
如何在此处插入购买编号?
我正在尝试使用 magmi 导入图像。我收到SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -错误。
我尝试更改数据库的用户名和密码。但我无法更改,当我单击保存配置时,它们会恢复为旧的。
我怎样才能解决这个问题?
这是一个管理表单,我在其中添加了一个自定义选项卡,以便向其中添加一些自定义字段。该表格工作正常。但我需要添加field dependency一些字段。
如果该字段zipbasedprice_isrange设置为yes,那么我需要显示其他两个字段;如果它设置为no,则只应显示一个字段。
我如何使用下面的表格来实现这一点?
字段依赖关系应位于zipbasedprice_isrange, zipbasedprice_zip, zipbasedprice_zip_from_zip&之间zipbasedprice_zip_to_zip。
public function getFormHtml() {
$form = new Varien_Data_Form(
array('id' => 'edit_form', 'action' => $this->getData('action'), 'method' => 'post')
);
$this->getLayout()->createBlock('adminhtml/widget_form_renderer_element').
$this->getLayout()->createBlock('adminhtml/widget_form_renderer_fieldset').
$this->getLayout()->createBlock('adminhtml/widget_form_renderer_fieldset_element');
$fieldset = $form->addFieldset('zipbasedprice_fields', array('legend' => Mage::helper('zipbasedprice')->__('Zip Based Price'))
);
$default_country = array('label' => 'IN', 'code' => 'India');
$fieldset->addField('zipbasedprice_country', 'select', array(
'name' => 'zipbasedprice_country',
'label' => Mage::helper('zipbasedprice')->__('Country'),
'values' => Mage::getModel('adminhtml/system_config_source_country')->toOptionArray(),
'required' => true,
'style' => 'width:275px',
'value' => $default_country, …Run Code Online (Sandbox Code Playgroud) 我们为访问者提供了一个选项,如下图所示。他们将选择单选按钮并单击submit按钮。
但我想样改变这个,手段来替代点击Radio buttons我们应该点击stars
我可以通过以下代码隐藏星星:
.ratings .rating-box .rating
{
display : none;
}
Run Code Online (Sandbox Code Playgroud)
现在我想Radio buttons变成星星。此外,我想像第二张图片一样显示彼此更近的每颗星星。
css
input[type="radio"] {
box-sizing: border-box;
padding: 0;
}
.checkbox, .radio {
position: relative;
top: -1px;
display: inline-block;
}
Run Code Online (Sandbox Code Playgroud)
html
<?php if( $this->getRatings() && $this->getRatings()->getSize()): ?>
<h4><?php echo $this->__('Your Rating') ?> <em class="required"></em></h4>
<span id="input-message-box"></span>
<table class="data-table review-summary-table ratings" id="product-review-table">
<col width="1" />
<col />
<col />
<col />
<col />
<col />
<thead>
<tr>
<th> </th>
<th>
<div …Run Code Online (Sandbox Code Playgroud) 在 magento 中需要添加多个图像的产品 id。
$count = 0;
$imgArray = array($fpath.'configurable.png');
foreach ($imgArray as $image){
$imgUrl = _save_image( $image,$objectManager );
if ($count == 0){
$configProduct->addImageToMediaGallery( $imgUrl , $mediaAttribute, true, false );
}else {
$configProduct->addImageToMediaGallery( $imgUrl , null, true, false );
}
$count++;
}
Run Code Online (Sandbox Code Playgroud) 在我的模型中,我有一些 function(),我在提交表单时调用它,所以在这个 function() 中我做了一些写查询,Mage::getSingleton('adminhtml/session')->addSuccess('Ok !');
如果数据上传,我想显示成功消息,否则我显示错误消息,Mage::getSingleton('adminhtml/session')->addError('KO !');
但是在同一页面中。我试图做 $this->_redirectReferer(); 但我有一个错误。
模型中的函数()
public function setTestimony($name, $testimony, $image_url, $vendor_id, $is_active) {
$write = Mage::getSingleton('core/resource')->getConnection('core_write');
if ($name != "" && $testimony != "" && $vendor_id !="" && $is_active != "" ) {
$insert = "INSERT INTO wlc_testimony (`name`, `testimony`, `image_url`, `vendor_id`, `is_active`)
VALUES ('$name', '$testimony', '$image_url', '$vendor_id', '$is_active')";
$write->query($insert);
$this->_redirectReferer();
Mage::getSingleton('adminhtml/session')->addSuccess('Témoignage ajouté !');
}else{
$this->_redirectReferer();
Mage::getSingleton('adminhtml/session')->addError('Témoignage non ajouté !!');
}
}
Run Code Online (Sandbox Code Playgroud) 所以我想为我的本地主机 Magento2 安装安装 OpenSearch,但我只能找到使用 Docker 的安装方法。
我没有使用 Docker 有几个原因,这与我现在所在的公司有关,但我真的很想在我自己的计算机上本地安装 OpenSearch,并在本地运行它,而不是使用其他程序,例如Docker,这可能吗?
顺便提一句; 我使用的是 Ubuntu 22.04 和 Magento 2.4.6(如果知道这一点很重要的话,哈哈)
提前致谢!
magento ×10
magento-1.7 ×3
php ×3
magento-1.9 ×2
magento2 ×2
css ×1
forms ×1
html ×1
magento-1.4 ×1
magento-1.8 ×1
magmi ×1
mysql ×1
opensearch ×1
ubuntu ×1