Skip to content

Instantly share code, notes, and snippets.

View rameshelamathi's full-sized avatar

Ramesh Elamathi rameshelamathi

View GitHub Profile
@rameshelamathi
rameshelamathi / products.php
Created February 17, 2016 09:14
Search description
if($state->search){
$query->where(
' ( '.
'a.'.$db->qn('title').' LIKE '.$db->q('%'.$state->search.'%').'OR '.
'a.'.$db->qn('introtext').' LIKE '.$db->q('%'.$state->search.'%').'OR '.
'a.'.$db->qn('fulltext').' LIKE '.$db->q('%'.$state->search.'%').'OR '.
$db->qn('#__j2store_products').'.'.$db->qn('j2store_product_id').' LIKE '.$db->q('%'.$state->search.'%').'OR '.
$db->qn('#__j2store_products').'.'.$db->qn('product_source').' LIKE '.$db->q('%'.$state->search.'%').'OR '.
$db->qn('#__j2store_variants').'.'.$db->qn('sku').' LIKE '.$db->q('%'.$state->search.'%').'AND a.state =1 OR '.
$db->qn('#__j2store_variants').'.'.$db->qn('price').' LIKE '.$db->q('%'.$state->search.'%').'AND a.state =1 OR '.
@rameshelamathi
rameshelamathi / orderitems.php
Created February 25, 2016 06:19
View filters in invoice
<?php
/**
* @package J2Store
* @copyright Copyright (c)2014-17 Ramesh Elamathi / J2Store.org
* @license GNU GPL v3 or later
* This file is for email.
*/
// No direct access to this file
defined ( '_JEXEC' ) or die ();
$order = $this->order;
@rameshelamathi
rameshelamathi / ordersummary.php
Created February 25, 2016 07:25
View filters
<?php
/**
* @package J2Store
* @copyright Copyright (c)2014-17 Ramesh Elamathi / J2Store.org
* @license GNU GPL v3 or later
*/
// No direct access to this file
defined ( '_JEXEC' ) or die ();
$order = $this->order;
$items = $this->order->getItems();
@rameshelamathi
rameshelamathi / j2store.php
Created March 7, 2016 15:14
Remove unpublished item from cart
function onJ2StoreAfterGetCartItems(&$items) {
foreach($items as $key=>$item) {
if($item->product_source == 'com_content') {
$article = J2Store::article()->getArticle($item->product_source_id);
if($article->state != 1) {
unset($items[$key]);
}
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<!--
* @com_j2store - J2Store
* @author Sasi varna kumar - Weblogicx India http://www.weblogicxindia.com
* @copyright Copyright (C) 2014 - 19 Weblogicxindia.com. All Rights Reserved.
* @license - http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
* @Websites: http://j2store.org
* @Technical Support: Forum - http://j2store.org/forum/index.html
-->
<form
@rameshelamathi
rameshelamathi / form_images.php
Last active March 23, 2016 14:37
Joomla 3.5 fix
<?php
/**
* @package J2Store
* @copyright Copyright (c)2014-17 Ramesh Elamathi / J2Store.org
* @license GNU GPL v3 or later
*/
// No direct access
defined('_JEXEC') or die;
$image_counter = 0;
@rameshelamathi
rameshelamathi / module_position.php
Last active March 26, 2016 14:04
It will work in the template overrides for cart and checkout. Example, you can add this to checkout page and publish a module to the custom position: your_module_position
$order = F0FModel::getTmpInstance('Orders', 'J2StoreModel')->initOrder()->getOrder();
$product_list_array = array(21, 23, 35, 38 , 39);
$items = $order->getItems();
$module_status = false;
foreach($items as $item){
if($item->product_id == 28){
$module_status = false;
break;
}
if(in_array($item->product_id,$product_list_array)){
<div class="option-additional-info option-additional-info-<?php echo $option['product_option_id']; ?>">
<?php if(isset($option_value['pov_short_desc']) && !empty($option_value['pov_short_desc'])): ?>
<?php echo $option_value['pov_short_desc']; ?>
<?php endif; ?>
<?php if(isset($option_value['pov_long_desc']) && !empty($option_value['pov_long_desc'])): ?>
<?php echo $option_value['pov_long_desc']; ?>
<?php endif; ?>
<?php if(isset($option_value['pov_ref']) && !empty($option_value['pov_ref'])): ?>
<?php echo $option_value['pov_ref']; ?>
<?php endif; ?>
@rameshelamathi
rameshelamathi / default_register.php
Created April 8, 2016 07:04
Japanese localisation
//$html = $this->storeProfile->get('store_billing_layout');
$lang = JFactory::getLanguage()->getTag();
if($lang == 'ja-JP') {
//we dont have a profile set in the store profile. So use the default one.
$html = '<div class="'.$J2gridRow.'">
<div class="'.$J2gridCol.'6"> [last_name][first_name] [email] [phone_1] [phone_2] [password] [confirm_password]</div>
<div class="'.$J2gridCol.'6">[company] [tax_number] [address_1] [address_2] [city] [zip] [country_id] [zone_id]</div>
</div>';
}else {
$html = '<div class="'.$J2gridRow.'">
<?php if(JFactory::getLanguage()->getTag() == 'ja-JP'): ?>
<?php if ($address->j2store_address_id == $this->address_id) : ?>
<option value="<?php echo $address->j2store_address_id; ?>" selected="selected">
<?php echo $address->country_name; ?> <?php echo $address->first_name; ?> <?php echo $address->last_name; ?>, <?php echo $address->address_1; ?>, <?php echo $address->city; ?>, <?php echo $address->zip; ?>, <?php echo $address->zone_name; ?>
</option>
<?php else: ?>
<option value="<?php echo $address->j2store_address_id; ?>">
<?php echo $address->country_name; ?> <?php echo $address->first_name; ?> <?php echo $address->last_name; ?>, <?php echo $address->address_1; ?>, <?php echo $address->city; ?>, <?php echo $address->zip; ?>, <?php echo $address->zone_name; ?>
</option>