This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Tested on Magento CE 1.4.1.1 - 1.9.2 | |
SET FOREIGN_KEY_CHECKS=0; # important | |
############################## | |
# SALES RELATED TABLES | |
############################## | |
TRUNCATE `sales_flat_creditmemo`; | |
TRUNCATE `sales_flat_creditmemo_comment`; | |
TRUNCATE `sales_flat_creditmemo_grid`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Under every function there is an example of the output value: | |
Output : http://example.com/ | |
<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?> | |
Output : http://example.com/js/ | |
<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS); ?> | |
Output : http://example.com/index.php/ | |
<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK); ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function my_pmprorh_init() | |
{ | |
$last_university = get_option('last_university'); | |
$last_university = explode(',', $last_university); | |
$highest_level_of_education = get_option('highest_level_of_education'); | |
$highest_level_of_education = explode(',', $highest_level_of_education); | |
// print_r($last_university); | |
if (!function_exists('pmprorh_add_registration_field')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#File name : /your-custom-module/view/frontend/layout/catalog_product_view.xml | |
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> | |
<body> | |
<referenceContainer name="product.info.main"> | |
<block class="[Namespace]\[Modulename]\Block\Product\View\SomeName" | |
after="-" | |
name="customname.somename" | |
template="product/view/custom_template_name.phtml" /> | |
</referenceContainer> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Shortcode for property serach form | |
* @author Saurabh Ranjan | |
* <button type="button">Review Property</button> | |
*/ | |
TODO: | |
1) chagne `post_type` as per your need | |
2) change `custom_meta` as per your need | |
3) Update $HTML as per need |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Create custom meta box | |
*/ | |
// code is taken from stackoverflow and did some changes as per requirements. | |
add_action( 'add_meta_boxes', 'dynamic_add_box' ); | |
/* Do something with the data entered */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
These is Individual commands for re-indexing:- | |
php shell/indexer.php --reindex catalog_category_flat | |
php shell/indexer.php --reindex catalog_category_product | |
php shell/indexer.php --reindex catalogsearch_fulltext | |
OR run all re-indexing:- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$url = 'fileName.xml'; | |
$xml = simplexml_load_file($url); // load | |
$jsonEncode = json_encode($xml); // encode | |
$arrayData = json_decode($jsonEncode,TRUE); // decode , that's it now every thing is in array no need to query as object or parse to string | |
dump($arrayData['residential'][0]['agentID']); | |
dump($arrayData['residential'][0]['uniqueID']); | |
dump($arrayData['residential'][0]['tenancy']); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* The onOpen function runs automatically when the Google Docs document is | |
* opened. Use it to add custom menus to Google Docs that allow the user to run | |
* custom scripts. For more information, please consult the following two | |
* resources. | |
* | |
* Extending Google Docs developer guide: | |
* https://developers.google.com/apps-script/guides/docs | |
* | |
* Document service reference documentation: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// get the attribute | |
add_action( 'woocommerce_shop_loop_item_title', 'show_attribute_custom_action', 15 ); | |
function show_attribute_custom_action() { | |
global $product; | |
$sizeAttribute = array_shift( wc_get_product_terms( $product->id, 'pa_size', array( 'fields' => 'names' ) ) ); |
OlderNewer