User Tools

Site Tools


php:magento

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

php:magento [2018/08/09 09:06] – [config and edit display of left column from admin] adminphp:magento [2022/10/29 16:15] (current) – external edit 127.0.0.1
Line 607: Line 607:
   - step4: update display chatango in left bar:<code html>   - step4: update display chatango in left bar:<code html>
 <script id="cid0020000087513494433" data-cfasync="false" async src="//st.chatango.com/js/gz/emb.js" style="width: 210px;height: 350px;">{"handle":"shopbabiesvn","arch":"js","styles":{"b":100,"c":"f97789","d":"006699","e":"fdfdfd","h":"f2f2f2","l":"9ddbf6","m":"FFFFFF","p":"10","q":"9ddbf6","r":100}}</script> <script id="cid0020000087513494433" data-cfasync="false" async src="//st.chatango.com/js/gz/emb.js" style="width: 210px;height: 350px;">{"handle":"shopbabiesvn","arch":"js","styles":{"b":100,"c":"f97789","d":"006699","e":"fdfdfd","h":"f2f2f2","l":"9ddbf6","m":"FFFFFF","p":"10","q":"9ddbf6","r":100}}</script>
 +</code>
 +==== top.links Header link (Include Login/Logout) ====
 +  * CMS Block to display links in **top.links.phtml**:<code php>
 +<?php if($toplinks && is_array($toplinks)): ?>
 +<ul class="links">
 +    <?php echo $this->getChildHtml() ?>
 +    <?php foreach($toplinks as $_toplink): ?>
 +    <li<?php if($_toplink['first']||$_toplink['last']): ?> class="<?php if($_toplink['first']): ?>first<?php endif; ?><?php if($_toplink['last']): ?> last<?php endif; ?>"<?php endif; ?> <?php echo $_toplink['liParams'] ?>><?php echo $_toplink['beforeText'] ?><a <?php echo $_toplink['aParams'] ?>><?php echo $_toplink['innerText'] ?></a><?php echo $_toplink['afterText'] ?></li>
 +    <?php endforeach; ?>
 +</ul>
 +</code>
 +  * Config links in layout customer.xml:<code xml>
 +<layout version="0.1.0">
 +
 +<!--
 +Default layout, loads most of the pages
 +-->
 +
 +    <default>
 +        <!-- Mage_Customer -->
 +        <reference name="top.links">
 +            <action method="addLink" translate="label title" module="customer"><label>My Account</label><url helper="customer/getAccountUrl"/><title>My Account</title><prepare/><urlParams/><position>10</position></action>
 +        </reference>
 +    </default>
 +
 +<!--
 +Load this update on every page when customer is logged in
 +-->
 +
 +    <customer_logged_in>
 +        <reference name="top.links">
 +            <action method="addLink" translate="label title" module="customer"><label>Log Out</label><url helper="customer/getLogoutUrl"/><title>Log Out</title><prepare/><urlParams/><position>100</position></action>
 +        </reference>
 +    </customer_logged_in>
 +
 +<!--
 +Load this update on every page when customer is logged out
 +-->
 +
 +    <customer_logged_out>
 +        <!---<reference name="right">
 +            <block type="customer/form_login" name="customer_form_mini_login" before="-" template="customer/form/mini.login.phtml"/>
 +        </reference>-->
 +        <reference name="top.links">
 +            <action method="addLink" translate="label title" module="customer"><label>Log In</label><url helper="customer/getLoginUrl"/><title>Log In</title><prepare/><urlParams/><position>100</position></action>
 +        </reference>
 +        <remove name="reorder"></remove>
 +    </customer_logged_out>
 </code> </code>
 ===== Database ===== ===== Database =====
-==== database init ====+==== Database init ====
 <code sql> <code sql>
 SELECT `core_url_rewrite`.* FROM `core_url_rewrite` WHERE (request_path IN ('/', '')) AND (store_id IN(0, 1)) SELECT `core_url_rewrite`.* FROM `core_url_rewrite` WHERE (request_path IN ('/', '')) AND (store_id IN(0, 1))
Line 844: Line 892:
 } }
 </code> </code>
-==== other optimize methods ====+==== Other optimize methods ====
   - re-index data   - re-index data
     * in admin     * in admin
Line 929: Line 977:
   * config base_url: table core_config_data: replace http://localhost to http://shop.babies.vn<code sql>   * config base_url: table core_config_data: replace http://localhost to http://shop.babies.vn<code sql>
 update core_config_data set value = 'http://shop.babies.vn/' where path in ('web/unsecure/base_url', 'web/secure/base_url','admin/dashboard/enable_charts'); update core_config_data set value = 'http://shop.babies.vn/' where path in ('web/unsecure/base_url', 'web/secure/base_url','admin/dashboard/enable_charts');
 +</code>
 +  * update site from https to non https:<code sql>
 +update core_config_data set value='0' where  path in ('web/secure/use_in_frontend', 'web/secure/use_in_adminhtml');
 </code> </code>
   * Clear all caches for activating new config:<code bash>   * Clear all caches for activating new config:<code bash>
Line 1054: Line 1105:
 Go to "Nhóm Sản Phẩm" -> Random Related Products to edit **"Number of items to show"** Go to "Nhóm Sản Phẩm" -> Random Related Products to edit **"Number of items to show"**
  
 +==== Update all categories to isAnchor ====
 +<code sql>UPDATE catalog_category_entity_int 
 +SET    value = 1 
 +WHERE  attribute_id = (SELECT attribute_id 
 +                       FROM   eav_attribute 
 +                       WHERE  attribute_code = 'is_anchor' 
 +                       LIMIT  1); 
 +</code>
 +==== Update Manufacture ====
 +Research Manufacture database <code sql>
 +select attribute_id, entity_type_id, attribute_code from eav_attribute where attribute_code="manufacture";
 +137 4 manufacture
 +
 +select option_id, value from eav_attribute_option_value where value like "%KIM%"
 +40 Kim Home
 +40 Kim Home
 +40 Kim Home
 +
 +select entity_id,NAME from catalog_product_flat_1 where NAME like "%KIM%";
 +1960 GỐI LÕM CARA KIM HOME
 +1955 GỐI ÔM CARA CHO BÉ 60x25cm KIM HOME
 +
 +INSERT INTO `catalog_product_entity_int` (`entity_type_id`,`attribute_id`,`store_id`,`entity_id`,`value`) VALUES ('4', '137', '0', '1960', '40') ON DUPLICATE KEY UPDATE `value` = VALUES(`value`)--only chage parameter 40(manufacture Kim Home) and 1960(Product Name)
 +
 +--list all products have manufacture with name like "%KIM HOME%"
 +select catp.entity_type_id, catp.attribute_id, catp.entity_id, catflat.name, catp.value from `catalog_product_entity_int` as catp  join catalog_product_flat_1 as catflat on catp.`entity_type_id` = 4 and catp.`attribute_id`=137 and catp.`entity_id` = catflat.`entity_id` and catflat.name like "%KIM HOME%";
 +
 +update `catalog_product_entity_int` as catp, catalog_product_flat_1 as catflat set catp.value = 40 where catp.`entity_type_id` = 4 and catp.`attribute_id`=137 and catp.`entity_id` = catflat.`entity_id` and catflat.name like "%KIM HOME%";
 +</code>
 +Update Manufacture from database:
 +  - Step1: Check manufacture information with name "Kim Home" from database<code sql>
 +select option_id, value from eav_attribute_option_value where value like "%KIM%"
 +40 Kim Home
 +40 Kim Home
 +40 Kim Home
 +</code> => option_id = 40
 +  - Step2: Update manufacture for all products with name like "%KIM HOME%" to manufacture value 40(Manufacture "Kim Home")<code sql>
 +update `catalog_product_entity_int` as catp, catalog_product_flat_1 as catflat set catp.value = 40 
 +where catp.`entity_type_id` = 4 and catp.`attribute_id`=137 and catp.`entity_id` = catflat.`entity_id` and catflat.name like "%KIM HOME%";
 +</code>
 +  - Step3: Recheck<code sql>
 +select catp.entity_type_id, catp.attribute_id, catp.entity_id, catflat.name, catp.value from 
 +`catalog_product_entity_int` as catp  join catalog_product_flat_1 as catflat on catp.`entity_type_id` = 4 and catp.`attribute_id`=137 and catp.`entity_id` = catflat.`entity_id` and catflat.name like "%KIM HOME%";
 +</code>
 ==== Magento upgrade ==== ==== Magento upgrade ====
 === upgrade with magento connect === === upgrade with magento connect ===
Line 1088: Line 1183:
 rm -rf /data/www/babyshopvnupdate/var/cache/* rm -rf /data/www/babyshopvnupdate/var/cache/*
 </code> </code>
 +==== Magento Email Configure ====
 +  - Advanced/System/Mail Sending Settings
 +  - General/Store Email Address
 +  - Sales/Sales Emails: Send Order Email Copy To:[email protected], [email protected]
 +  - You must sure that we can run cron command of magento
 ===== Magento and Wordpress ===== ===== Magento and Wordpress =====
 refer: http://www.thetomorrowlab.com/2014/03/integrating-wordpress-magento-build-ecommerce-website/ refer: http://www.thetomorrowlab.com/2014/03/integrating-wordpress-magento-build-ecommerce-website/
Line 1204: Line 1304:
 truncate table catalogsearch_result; truncate table catalogsearch_result;
 </code> </code>
-===== Lazada support ===== 
  
php/magento.1533805577.txt.gz · Last modified: 2022/10/29 16:15 (external edit)