params= new JRegistry(); $this->params->loadString($plugin->params, 'JSON'); $this->_cacheEnabled = $this->params->get('cache_enabled'); if ($this->_cacheEnabled === null) $this->_cacheEnabled == 1; $this->_autoflush = $this->params->get('autoFlush'); if ($this->_autoflush === null) $this->_autoflush = 1; $this->_autoflush3rdParty = $this->params->get('autoFlush-ThirdParty'); if ($this->_autoflush3rdParty === null) $this->_autoflush3rdParty = 1; $this->_autoflushClientSide = $this->params->get('autoFlush-ClientSide'); if ($this->_autoflushClientSide === null) $this->_autoflushClientSide = 0; } /** * Heartbeat cache checking function. Will also monitor $_GET for the jSGCache parameter * (pressing the purge cache button in admin) * * * @access public * @return null */ public function onAfterInitialise() { if (!$this->_cacheEnabled || $this->_isBlacklisted($this->_applicationPath)) { JResponse::setHeader('X-Cache-Enabled','False',true); return; } if ($this->_cacheEnabled) { JResponse::allowCache(true); JResponse::setHeader('X-Cache-Enabled','True',true); } //Init the application url $this->_applicationPath = str_replace(array('administrator/index.php','index.php'),'',str_replace($_SERVER['DOCUMENT_ROOT'],'',$_SERVER['SCRIPT_FILENAME'])); //Check for any admin action and proceed to flushMonitor and 3rd party plugins if ( isset($_POST['task']) || isset($_GET['task']) || isset($_GET['cart_virtuemart_product_id'])) { $this->_flushMonitor(); if ($this->_autoflush3rdParty) $this->_monitorThirdPartyPlugins(); } //Check if we have a logged in user and enable cache bypass cookie 'task' => string 'user.login' $user = JFactory::getUser(); if (!$user->guest || (isset($_POST['task']) && preg_match('/login/i', $_POST['task']))) { $_POST[JSession::getFormToken()] = 1; //Force the correct token, since the login box on the page is cached with the 1st visitors' token //Enable the cache bypass for logged users by setting a cache bypass cookie setcookie('jSGCacheBypass',1,time() + 6000,'/'); } if ($user->guest || (isset($_POST['task']) && $_POST['task'] == 'user.logout')) { //Remove the bypass cookie if not a logged user if (isset($_COOKIE['jSGCacheBypass'])) setcookie('jSGCacheBypass',0, time() - 3600,'/'); } // Handle purge button press when get has jSGCache=purge, but only in admin with a logged user if(isset($_GET['jSGCache']) && $_GET['jSGCache'] == 'purge' && JFactory::getApplication()->isAdmin() && !$user->guest ) $this->_purgeCache(true); } /** * Admin panel icon display * * @access public * @param string $context * @return array */ public function onGetIcons( $context ) { return array(array( 'link'=>'?jSGCache=purge', 'image'=>'refresh', 'text'=>JText::_('Purge jSGCache'), 'id'=>'jSGCache' )); } /** * Calls the cache server to purge the cache * * @access public * @param string|bool $message Message to be displayed if purge is successful. If this param is false no output would be done * @return null */ private function _purgeCache( $message = true ) { $purgeRequest = $this->_applicationPath . '(.*)'; // Construct the PURGE request $hostname = str_replace( 'www.', '', $_SERVER['HTTP_HOST'] ); $purge_method = "PURGE"; $cacheServerSocket = fsockopen($hostname, 80, $errno, $errstr, 2); if(!$cacheServerSocket) { JError::raise(E_ERROR,500,JText::_('Connection to cache server failed!')); JError::raise(E_ERROR,500,JText::_($errstr ($errno))); return; } $request = "$purge_method {$purgeRequest} HTTP/1.0\r\nHost: {$_SERVER['SERVER_NAME']}\r\nConnection: Close\r\n\r\n"; if (preg_match('/^www\./',$_SERVER['SERVER_NAME'])) { $domain_no_www = preg_replace('/^www\./', '', $_SERVER['SERVER_NAME']); $request2 = "$purge_method {$purgeRequest} HTTP/1.0\r\nHost: {$domain_no_www}\r\nConnection: Close\r\n\r\n"; } else $request2 = "$purge_method {$purgeRequest} HTTP/1.0\r\nHost: www.{$_SERVER['SERVER_NAME']}\r\nConnection: Close\r\n\r\n"; fwrite($cacheServerSocket, $request); $response = fgets($cacheServerSocket); fclose($cacheServerSocket); $cacheServerSocket = fsockopen($hostname, 80, $errno, $errstr, 2); fwrite($cacheServerSocket, $request2); fclose($cacheServerSocket); if($message !== false) { if(preg_match('/200/',$response)) { if ($message === true) JFactory::getApplication()->enqueueMessage(JText::_('SG Cache Successfully Purged!')); else JFactory::getApplication()->enqueueMessage(JText::_( $message )); } else { JError::raise(E_NOTICE,501, JText::_('SG Cache: Purge was not successful!')); JError::raise(E_NOTICE,501, jText::_('Error: ' . $response)); } } } /** * Check if url is in caching blacklist * * @param string $applicationPath * * @return bool */ private function _isBlacklisted($applicationPath) { $blacklistArray = explode("\n",$this->params->get('blacklist')); $blacklistRegexArray = array(); $indexIsBlacklisted = false; foreach($blacklistArray as $key=>$row) { $row = trim($row); if ($row != '/' && $quoted = preg_quote($row,'/')) $blacklistRegexArray[$key] = $quoted; if ($row == '/') $indexIsBlacklisted = true; } if ($indexIsBlacklisted && $_SERVER['REQUEST_URI'] == $applicationPath) return true; if (empty($blacklistRegexArray)) return false; $blacklistRegex = '/('.implode('|',$blacklistRegexArray) . ')/i'; return preg_match($blacklistRegex, $_SERVER['REQUEST_URI']); } /** * 3rd party plugin monitor * * @access private * @return null */ private function _monitorThirdPartyPlugins() { // Kunena & K2 if ($this->params->get('autoFlush-ThirdParty') == 1 && isset($_POST['option']) && ($_POST['option']=='com_k2' || $_POST['option' ]== 'com_kunena')) { $this->_purgeCache(false); } // VirtueMart if ( (isset($_POST['option']) && $_POST['option'] == 'com_virtuemart') || ( isset($_GET['option']) && $_GET['option'] == 'com_virtuemart' ) || isset($_GET['cart_virtuemart_product_id']) ) { if($this->params->get('autoFlush-ThirdParty') == 1) $this->_purgeCache(false); } } /** * Action monitor * * @access private * @return null */ private function _flushMonitor() { $user = JFactory::getUser(); if ((!JFactory::getApplication()->isAdmin() && !$this->_autoflushClientSide) || $user->guest) return; $autoflush = $this->params->get('autoFlush'); if ($autoflush === null) $autoflush = 1; if (isset($_POST['task']) && $_POST['task'] && !in_array($_POST['task'],self::$_ignoreTasks) && $autoflush == 1) $this->_purgeCache(false); } } Community Support Forums - Sellacious
  Saturday, 05 May 2018
  11 Replies
  3.8K Visits
  Subscribe
Hi, how do I add a dropdown menu to the seller registration form? I want to add a region dropdown to the seller registration; I have already added the regions under our country (Ireland) using Geolocations. I then want to be able to use a search on the index page where the user can search for products listed in their region.
6 years ago
·
#1873
Hello Vince,

1. As for drop-down field in seller form, you can create the custom profile fields in the sellacious backend from Additional Attribute > Custom From Field.
And then add this custom field to the seller category you want.

2. And as for your second issue. This feature is not available in the current version but will be available in next version of sellacious.

Thank you
-Team Sellacious
6 years ago
·
#1881
Thanks Vijaya,
When I fill in the custom fo field, I have the following:
Field /type:Radio
Field Group: Contact Address
Field Name: County
Alias: county
CCS Class: inputbox (What are the options here?)
Radio Options: (how do i enter the options here. I tried to enter as comma delimited but it gave me an error when I tried to save it.)
6 years ago
·
#1883
Hello Vince,

You need to press enter after submitting the radio text then save it.

Thank you

-Team Sellacious
6 years ago
·
#1890
OK, that worked. I was able to add options.

I cannot get it to save in the Custom Form Field section, I only have options for Query Group or Contact Address. See attached Assignment.png

Also, I saved it under each of those sections but I cannot add it to the seller profile fields; when I search for it in the Custom Profile Fields input, it cannot find it. see attached profileFields.png
6 years ago
·
#1891
Hello Vince,

You need to create these form fields under profile fields menu NOT in query form fields.

Once you create a form field in Profile form field, you'll be able to see the form fields in the user profile.

Thank you

-Team Sellacious
6 years ago
·
#1892
You told me before to put them under Custom Form fields; " you can create the custom profile fields in the sellacious backend from Additional Attribute > Custom From Field. "

Anyway, I tried putting them under profile fields; which Field Group do I use? there is no option for Profile.
6 years ago
·
#1893
Hello Vince,

If you're using sellacious latest version then profile fields would be there, below product attributes.

If you want you can give me your site credentials, I'll do it for you.
5 years ago
·
#2392
Hi,

I'm trying to add some additional form fields in the seller and client registration forms, as well as product attributes.

However, I'm unable to see the "custom form field" option under "additional attribute".

I added the "New" form field in Additional Attribute > Profile fields. But when I went back to Categories > Seller > Profile Fields, to add the field in the Default Seller Category, the new field was not available in the "Custom Profile Fields" text box/dropdown.

Please advice.
Thanks
5 years ago
·
#2393
Hello,

You need to create a Profile Field group first after that create a form field you want under the field group you have created. Save that field.

Now, you'll be able to select that field in the User category you want.

I hope this will help.

Thank You
-Team Sellacious
5 years ago
·
#2412
Hi Vijaya,
Thanks for the reply.
Sorry, I'm not a joomla/sellacious expert yet, so could you please specify a bit - where do I need to create a Profile Field Group and then where do I need to create a Form Field, in order to be able to add more fields in the seller, client, and product profiles?
Thanks.
5 years ago
·
#2414
Hello Zefill,

We'll be glad to help you.

To create the profile fields, Go to the Sellacious Administrator > Attributes > Profile Fields. Click on New button and create a field group first. After creating a Field group, create the fields you want like Name, Number in this field group.

Now, go to Categories > Client / Seller > Select the category you want to add fields to > Profile fields > Custom fields. Here select the fields you want to add.

I hope this helps.

Thank You
  • Page :
  • 1
There are no replies made for this post yet.
Be one of the first to reply to this post!
  • +1 (408) 821-8283
  • Email hello@sellacious.com