`
kirenenko04
  • 浏览: 147295 次
  • 性别: Icon_minigender_2
  • 来自: 上海
社区版块
存档分类
最新评论
文章列表
1.要覆盖原生验证类,先定义在config文件里: <models> <customer_address> <rewrite> <abstract>Bysoft_Mycustomer_Model_Address_Abstract</abstract> </rewrite> </customer_address> </models>  2.把文件/app/code/co ...
class Mage_Shell_ExportCategory extends Mage_Shell_Abstract { /** * Run script * */ public function run() { ini_set("memory_limit","1000M"); umask(0); $category = Mage::getModel ('catalog/category'); $tree = $category-&g ...
<script type="text/javascript"> // <![CDATA[ jQuery(document).ready(function(e) { checkoptions(); jQuery("select.super-attribute-select").change(function(){ checkoptions(); }); }); function checkoptions(){ ...
<script> spConfig.setInitialState = function(dropdown_id) { //select dropdown var dropdown = $(dropdown_id); //remove empty option from dropdown so it is not selectable after initial selection dropdown[0].remove(); //c ...
在topmenu.phtml文件里。增加以下JS.(function($){ $.ajax({ url: "<?php echo $this->getUrl('checkout/cart/headcount');?>", type: "POST", dataType:"json", success: function(data) { $('.cart_header').html(data[ ...
 如上图所见的配置。   说明这个可配置商品的可变价格属性是数量。和颜色属性无关。当数量是2个的时候它会价格有变化。   它是Magento内置的功能,这样配置后前台可以再选择不同的option value的时候使得价格发生变化。   而控制这部分数据的。 是这张表: SELECT * FROM catalog_product_super_attribute_pricing  表数据如下:  其他字段很明显,product_super_attribute_id来自于关联表catalog_product_super_attribute select * from cata ...

post 方式提交数据

    博客分类:
  • php
public function getPrice($data) { $url='http://www.xxx.com/templates/common/products/productProperties.cfm'; $timestamp = time(); $uniqueId = $data['product_id'].'33'; $post='noCache='.$timestamp. '&buyForm'.$uniqueId.'_productId='.$data['product_id']. ...
$ctx = stream_context_create(array( 'http'=>array( 'timeout'=>'3', 'proxy'=>'tcp://127.0.0.1:8087', 'request_fulluri'=>true, ) ) ); $data = file_get_contents($url,'0', $ctx);   
class Mage_Shell_CleanSpcialPrice extends Mage_Shell_Abstract { /** * Run script * */ public function run() { $collection = Mage::getModel('catalog/product')->getCollection() //->addAttributeToFilter('type_id', 'configurable') -> ...
require_once 'abstract.php'; /** * Magento Compiler Shell Script * * @category Mage * @package Mage_Shell * @author Magento Core Team <core@magentocommerce.com> */ class Mage_Shell_UpdateHasImageSimpleProductVisibility extends Mage_Shell_Abstract { /** ...
这个比较麻烦。有两个可配置想 例如一种鞋子有(尺寸:35,36,37,和颜色:红,黄,蓝) 那么它就有3*3=9种简单商品,还有一个可配置商品   public function importDoubleMixProduct() { //获取这种类型的商品ID; $read= Mage::getSingleton('core/resource')->getConnection('core_read'); $sql = "SELECT product_id,COUNT(*) FROM (SELECT product_id,option_i ...
public function addCustomer($data) { Mage::app()->setCurrentStore(1); $websiteId = 1; $store = Mage::app()->getStore(); if (!$this->customerExists($data['email'])) { $customer = Mage::getModel("customer/customer"); $customer->setW ...
public function addOld() { $read= Mage::getSingleton('core/resource')->getConnection('core_read'); $sql ="select * from `old_newsletter` where status = 0"; $results = $read->query($sql); $write = Mage::getSingleton('core/resource')->getConnecti ...

parse url param key value

    博客分类:
  • php
function convertUrlQuery($query) { $queryParts = explode('&', $query); $params = array(); foreach ($queryParts as $param) { $item = explode('=', $param); $params[$item[0]] = $item[1]; } return $params; } function use($key) { $url = $ ...

parse html node content

    博客分类:
  • php
在使用之前先导入类文件: require_once 'simple_html_dom.php';  使用: foreach ($results as $row) { $html = new simple_html_dom(); $html->load($row['html']); $ret = $html->find('td.productOptionPrompt'); $id = $row['id']; if (count($ret)) { foreach ($ret as $e) { $option ...
Global site tag (gtag.js) - Google Analytics