Acymailing subscribe checkbox

  • Posts: 1119
  • Thank you received: 114
7 years 7 months ago #267404

-- HikaShop version -- : 1703151055

Hi,

With new checkout it seems there is no way to display subscribe to newsletter checkbox. After ajax refresh checkbox doesn't display and you need to refresh page to see it again. I assume its because checkbox is added via js?

Is there a way to fix it or should we contact acymailing regarding this?


I also see same issue with chosen library. If it is enabled and you have dropdown in checkout, after ajax refresh it wont be applied and you need to refresh page....

Thank you

Please Log in or Create an account to join the conversation.

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
7 years 7 months ago #267430

Hi,

Indeed, it will require AcyMailing to modify their auto susbcription plugin to add such trigger:

function onHikashopBeforeDisplayView(&$view){
		$config = hikashop_config();
		if($config->get('checkout_legacy',0))
			return true;
		$viewName = $view->getName();
		if($viewName != 'checkout')
			return true;

		if(!isset($view->workflow_step) || !isset($view->workflow) || !isset($view->workflow['steps'][$view->workflow_step]['content']))
			return true;

		if(!isset($view->extraData))
			$view->extraData = array();
		$after = ($this->params->get('fieldafter','password') == 'email') ? 'top' : 'middle';
		$subText = $this->params->get('captchatext');
		if(empty($subText)){
			$subText = JText::_('Captcha');
		}

		$c = new hikaShopRecaptcha2();
		$html = '<div class="hkform-group control-group hikashop_registration_recaptcha_line" id="hikashop_registration_recaptcha_line"><label id="captchamsg" for="grecaptcha" class="hkc-sm-4 hkcontrol-label" title="">'.$subText.'*</label><div class="hkc-sm-8">'.$c->recaptcha_get_html($this->params->get('public_key'),$this->params->get('theme'), @$view->ajax).'</div></div>';
		foreach($view->workflow['steps'][$view->workflow_step]['content'] as $k => $v) {
			if($v['task'] != 'login')
				continue;
			if(!isset($view->extraData[$k]))
				$view->extraData[$k] = new stdClass();
			if(!isset($view->extraData[$k]->$after))
				$view->extraData[$k]->$after = array();

			$view->extraData[$k]->$after[] = $html;
		}
	}
(that's taken straight from the recaptcha plugin which we modified to support the same thing since it has to do the same thing, ie add some HTML to the registration form of HikaShop.
Regarding chozen, we'll have that working with the next version.

Please Log in or Create an account to join the conversation.

  • Posts: 1119
  • Thank you received: 114
7 years 7 months ago #267458

Hi,

Can i just copy paste it inside plugin or i should contact acymailing so they could adapt it?

The code you provided is above my knowledge.

Thanks

Please Log in or Create an account to join the conversation.

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
7 years 7 months ago #267508

Hi,

No, that's a copy/paste of the code we have in the Recaptcha plugin.
That code will have to be adapted to do what needs to be done to display the checkboxes.

The following user(s) said Thank You: kyratn

Please Log in or Create an account to join the conversation.

  • Posts: 1119
  • Thank you received: 114
7 years 7 months ago #267682

Hi,

Just want to let you know that I have receive a replay from acymailing. They will update the plugin and the new version will be released in the next AcyMailing version which will be out in the upcoming months.

Thanks

Please Log in or Create an account to join the conversation.

Time to create page: 0.042 seconds
Powered by Kunena Forum