Jump to content

Archived

This topic is now archived and is closed to further replies.

keat

Orange closed email accounts

Recommended Posts

I didn't see this coming, but then I don't have one of the affected email addresses, but last week Orange closed a whole host of free email addresses.

  • Orange.net
  • Orangehome.co.uk
  • Wanadoo.co.uk
  • Freeserve.co.uk
  • Fsbusiness.co.uk
  • Fslife.co.uk
  • Fsmail.net
  • Fsworld.co.uk
  • Fsnet.co.uk

Is there a mod available that would generate a popup if a customer logged in with one the affected email accounts.

Share this post


Link to post
Share on other sites

Could you search for the email addresses and add them to a Group? That might give you a way to show them text that others would not see.

Share this post


Link to post
Share on other sites

I did consider groups thinking that I could somehow segregate these customers, but I don't see any way to create a login message.

I guess this feature hasn't yet been thought of .

 

mmmmmm, i can see a request post coming.

Share this post


Link to post
Share on other sites

@bsmither helped me solve including a YouTube embed for a specific category. Maybe something similar would allow extra text for just that group.

 

Share this post


Link to post
Share on other sites

This looks like it worked:

This did NOT work, but I think it would if the expression was correct.

content.account.php

<h2>{$LANG.account.your_account}</h2>
{if $pricing_group.product_id = '1' }
<h3>Please change your login email address and password</h3>
{/if}

where customer is added to Group with id=1 (I found the correct id number from phpMyAdmin.

Share this post


Link to post
Share on other sites

I'm struggling a little.

I added all the affected email addresses to a group, but then realised that I ought to really test it, so I added myself as well.

Now when I log in, I see the warning message, but after taking myself out of the group, I still see the message.

I tried a number of things, cleared the cache, cleared my browser cache, but still I see the message.

Not until I restored the original file, did the message subsbide, so at the moment, it looks as if the file edit is displaying the message to every login.

 

 

are you sure              '$pricing_group.product_id ='              is the correct string to use ??

 

should it not be $customer_membership.group_id

 

 

 

ah, I tried that, and the same thing happens.

Share this post


Link to post
Share on other sites
52 minutes ago, keat said:

are you sure              '$pricing_group.product_id ='              is the correct string to use ??

No - it's not. I've tried several different strings, but couldn't figure out what would work.

Bsmither does something like add {debug} to the bottom of the file he needs to see what is available. You get a popup. Keep the popup, but delete the {debug} from the file.

I tried looking at the popup, but I just don't understand it all well enough to be able to spot what is needed.

Share this post


Link to post
Share on other sites

It sure looks like this should have worked, but it doesn't.

{if $customer_membership.group_id = '1'}

Share this post


Link to post
Share on other sites
1 hour ago, Dirty Butter said:

It sure looks like this should have worked, but it doesn't.

{if $customer_membership.group_id = '1'}

If that is the correct variable (I haven't checked), the reason it isn't working is because you are using an assignment operator instead of a comparison operator. In other words, you are telling the code to set the group_id to equal 1, rather than checking if it is equal to 1.

One example of correct syntax is:

{if $customer_membership.group_id == '1'}

Note the double equals sign (==) - this is the non-strict comparison operator which will evaluate to true whether group_id is the integer 1 or the string '1'.

Share this post


Link to post
Share on other sites

Hoping that this was the answer, i made the edit, but I can't get the message to display.

 

<div>
  <h2>{$LANG.account.your_account}</h2>
  {if $customer_membership.group_id == '2'}
<h1>Your email address is no longer valid, Please update your details.</h1>
{/if}
  <div id="myaccount">    
    <ul>
      <li><a href="{$STORE_URL}/index.php?_a=profile" title="{$LANG.account.your_details}">{$LANG.account.your_details}</a></li>
      <li><a href="{$STORE_URL}/index.php?_a=addressbook" title="{$LANG.account.your_addressbook}">{$LANG.account.your_addressbook}</a></li>
      <li><a href="{$STORE_URL}/index.php?_a=vieworder" title="{$LANG.account.your_orders}">{$LANG.account.your_orders}</a></li>
      <li><a href="{$STORE_URL}/index.php?_a=downloads" title="{$LANG.account.your_downloads}">{$LANG.account.your_downloads}</a></li>
      <li><a href="{$STORE_URL}/index.php?_a=newsletter" title="{$LANG.account.your_subscription}">{$LANG.account.your_subscription}</a></li>
      {foreach from=$ACCOUNT_LIST_HOOKS item=list_item}
      <li><a href="{$list_item.href}" title="{$list_item.title}">{$list_item.title}</a></li>
      {/foreach}
    </ul>
  </div>
</div>

Share this post


Link to post
Share on other sites

I don't think that i'll ever understand PHP, it probably takes years of hard work and dedication.

I thought that i'd stumbled upon the issue, but sadly not.

 

Change   {if $customer_membership.group_id == '2'}

to   if {$customer_membership.group_id == '2'}

I'll keep digging though.

 

 

Does this need someing to compare the two database tables.

ie something along the lines ..

if   $customer_customer_id == $customer_membership.customer_id and $customer_membership.group_id ==2 then echo my string ??

Share this post


Link to post
Share on other sites

Part of your problem may be that CubeCart doesn't by default share the customer group membership data with SMARTY, so the variable `$customer_membership` shouldn't even exist unless you have specifically set it yourself.

Another issue is that fetching customer memberships would give you an array, not a single value, so it will never be equal to 2.

This code will do what you need:

// You can create a snippet for `class.cubecart.display_homepage` or just add this code
// directly to `cubecart.class.php::displayHomePage()` around line 128:
$GLOBALS['smarty']->assign('CUSTOMER_GROUPS', $GLOBALS['user']->getMemberships());

// Then add the following to your `content.homepage.php` template, probably right before the {if $LATEST_PRODUCTS} line
{if isset($CUSTOMER_GROUPS)}
	{foreach from=$CUSTOMER_GROUPS item=group}
		{if $group.group_id == 2}
			<div class="small-12">
				<p>Your message here</p>
			</div>
			{break}
		{/if}
	{/foreach}
{/if}

 

Share this post


Link to post
Share on other sites

We get customers who give us faulty email address quite frequently. I can see this being very useful, not just for these no longer valid free addresses.

Your code works perfectly @bsandall But a returning customer may not go to the homepage. Can it be made to show on the Account page, which is what they see when they login?

That was easy enough to move:

cubecart.class:

		// Custom Account Menu Items BSANDALL ADDED GROUPS TO SMARTY BELOW
		$account_list_hooks = array();
		foreach ($GLOBALS['hooks']->load('class.cubecart.account.list') as $hook) include $hook;
		$GLOBALS['smarty']->assign('ACCOUNT_LIST_HOOKS', $account_list_hooks);
$GLOBALS['smarty']->assign('CUSTOMER_GROUPS', $GLOBALS['user']->getMemberships());
		$content = $GLOBALS['smarty']->fetch('templates/content.account.php');
		$GLOBALS['smarty']->assign('SECTION_NAME', 'account');
		$GLOBALS['smarty']->assign('PAGE_CONTENT', $content);
	}

and content.account.php

<h2>{$LANG.account.your_account}</h2>
{if isset($CUSTOMER_GROUPS)}
	{foreach from=$CUSTOMER_GROUPS item=group}
		{if $group.group_id == 1}
			<div class="small-12">
				<h3>Your email address is no longer valid. Please edit your Profile.</h3>
			</div>
			{break}
		{/if}
	{/foreach}
{/if}

 

Share this post


Link to post
Share on other sites
23 minutes ago, Dirty Butter said:

We get customers who give us faulty email address quite frequently. I can see this being very useful, not just for these no longer valid free addresses.

Your code works perfectly @bsandall But a returning customer may not go to the homepage. Can it be made to show on the Account page, which is what they see when they login?

 

You could put it wherever you want, yes, provided you make sure to assign the customer group data to SMARTY before whatever page it is you want to display it on is loaded.

Share this post


Link to post
Share on other sites

OK - all that works, but we still have a problem. We manually added these email addresses to the Bad Email Group. Once the customer has changed their login email address they are STILL in that group. We need some way to automatically email us with their new email address, or we'll have to ask them to contact us. We now need some way to know to manually or automatically take them out of the group.

For now, I've worded it as

<h3>Your email address is not valid. Please edit your Profile. Then <a href="{$STORE_URL}/contact-us.htm">contact us</a> with your new email address, so we can finish upgrading our records.</h3>

 

Share this post


Link to post
Share on other sites
12 hours ago, Dirty Butter said:

OK - all that works, but we still have a problem. We manually added these email addresses to the Bad Email Group. Once the customer has changed their login email address they are STILL in that group. We need some way to automatically email us with their new email address, or we'll have to ask them to contact us. We now need some way to know to manually or automatically take them out of the group.

For now, I've worded it as

<h3>Your email address is not valid. Please edit your Profile. Then <a href="{$STORE_URL}/contact-us.htm">contact us</a> with your new email address, so we can finish upgrading our records.</h3>

 

I never thought of that.

Share this post


Link to post
Share on other sites

×
×
  • Create New...