magento

修复Magento SQLSTATE[23000]: Integrity constraint

别说谁变了你拦得住时间么 提交于 2020-02-05 05:50:16
magneto在意外情况下报错Magento SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry,出现这个问题最有可能是数据库因为非法重启关机等情况造成的。 去phpmyadmin里面把这几个表清空了,反正都是访问日志,一般这么处理后都会好。 TRUNCATE `sales_flat_quote`; ALTER TABLE `sales_flat_quote` AUTO_INCREMENT=1; TRUNCATE `sales_flat_quote_address`; ALTER TABLE `sales_flat_quote_address` AUTO_INCREMENT=1; TRUNCATE `sales_flat_quote_address_item`; ALTER TABLE `sales_flat_quote_address_item` AUTO_INCREMENT=1; TRUNCATE `sales_flat_quote_item`; ALTER TABLE `sales_flat_quote_item` AUTO_INCREMENT=1; TRUNCATE `sales_flat_quote_item_option`; ALTER TABLE `sales_flat_quote

Magento Shop by Brands [closed]

让人想犯罪 __ 提交于 2020-02-05 03:30:25
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 6 years ago . I am trying to add shop by brands in navigation.Here is my code <?php $product=Mage::getModel('catalog/product'); $attributeInfo=Mage::getResourceModel('eav/entity_attribute_collection')->addFieldToFilter('attribute_code','shoe_type')->load(false); $attribute=$attributeInfo->getFirstItem()-

Magento invoice grid filter_condition_callback not working

冷暖自知 提交于 2020-02-04 12:16:29
问题 I added a custom column to invoice grid using an observer. The problem is that I can't sort or filter by the new column. I added a filter condition callback but the function is not called. Here is my Observer.php class DB_CustomGrid_Model_Adminhtml_Observer { public function onBlockHtmlBefore(Varien_Event_Observer $observer) { $block = $observer->getBlock(); $payment_methods = array(); $readConnection = Mage::getSingleton('core/resource')->getConnection('core_read'); $query = 'SELECT method

Magento Product Images Full URL Path Instead of Cached

半世苍凉 提交于 2020-02-04 09:04:43
问题 The code below works for products that have images, but for products that don't have images, the placeholder small image doesn't show. echo Mage::getModel('catalog/product_media_config')->getMediaUrl( $_product->getSmallImage()); 回答1: <?php // get image full url echo $imageUrl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) . 'catalog/product' . $_product->getImage(); // get image using custom size with url echo $imageCacheUrl = Mage::helper('catalog/image')->init($_product, 'image'

Magento Product Images Full URL Path Instead of Cached

懵懂的女人 提交于 2020-02-04 09:04:30
问题 The code below works for products that have images, but for products that don't have images, the placeholder small image doesn't show. echo Mage::getModel('catalog/product_media_config')->getMediaUrl( $_product->getSmallImage()); 回答1: <?php // get image full url echo $imageUrl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) . 'catalog/product' . $_product->getImage(); // get image using custom size with url echo $imageCacheUrl = Mage::helper('catalog/image')->init($_product, 'image'

Magento Multiple Authorize.net Gateways

浪尽此生 提交于 2020-02-04 01:27:31
问题 I have a CAD and USD gateway accounts for processing credit card payments, both from a payment provider with support for the Authorize.net API. I've successfully configured one using Magento's built-in Authorize.net support... but how can I configure a second Authorize.net Gateway for use in my store? 回答1: You can reuse the existing authorize.net gateway if you assign separate websites to each currency. They don't need to be actually separate websites with their own domain, just to be

call to magento soap api expires immediately

冷暖自知 提交于 2020-02-03 09:41:51
问题 I'm trying to do a call to the magento api to get the details of a specific customer. When I do this call I always get the following error: PHP Fatal error: Uncaught SoapFault exception: [5] Session expired. Try to relogin. in /var/www/magento-client/magento-customer.php:12 Stack trace: /var/www/magento-client/magento-customer.php(12): SoapClient->__call('call', Array) /var/www/magento-client/magento-customer.php(12): SoapClient->call('a1a6863c7dadd95...', 'customer.info', 3) {main} thrown in

call to magento soap api expires immediately

江枫思渺然 提交于 2020-02-03 09:40:20
问题 I'm trying to do a call to the magento api to get the details of a specific customer. When I do this call I always get the following error: PHP Fatal error: Uncaught SoapFault exception: [5] Session expired. Try to relogin. in /var/www/magento-client/magento-customer.php:12 Stack trace: /var/www/magento-client/magento-customer.php(12): SoapClient->__call('call', Array) /var/www/magento-client/magento-customer.php(12): SoapClient->call('a1a6863c7dadd95...', 'customer.info', 3) {main} thrown in

How to set minimum purchase order amount

大兔子大兔子 提交于 2020-02-03 04:51:20
问题 When customer places an order, how to set minimum order amount? i.e) Total amount of order not below than $500. I know how to get total order amount. But I don't know where to place that code and where to check sOrderId = Mage::getSingleton('checkout/session')->getLastOrderId(); $oOrder = Mage::getModel('sales/order')->load($sOrderId); if($oOrder >=$500) { ..... } If customer has purchased total less than $500, they won't allow to checkout at the cart. 回答1: Login as admin, then go to System-

How to set minimum purchase order amount

旧巷老猫 提交于 2020-02-03 04:51:07
问题 When customer places an order, how to set minimum order amount? i.e) Total amount of order not below than $500. I know how to get total order amount. But I don't know where to place that code and where to check sOrderId = Mage::getSingleton('checkout/session')->getLastOrderId(); $oOrder = Mage::getModel('sales/order')->load($sOrderId); if($oOrder >=$500) { ..... } If customer has purchased total less than $500, they won't allow to checkout at the cart. 回答1: Login as admin, then go to System-