Jump to content

very puzzling - marketconnect add-ons still can be seen even though hidden


jacksony

Recommended Posts

Hi,

This is very strange. We did not enable SiteLock or CodeGuard in WHMCS MarketConnect.

In the WHMCS Add-ons, these are also set to "Hideen".

But the strange thing is when logging as customers, they still can select these as add-ons for the services.

Please help!

Link to comment
Share on other sites

11 hours ago, jacksony said:

This is very strange. We did not enable SiteLock or CodeGuard in WHMCS MarketConnect.

ever? I didn't think the products/addons got added to the database until the specific MC brand were enabled...

11 hours ago, jacksony said:

In the WHMCS Add-ons, these are also set to "Hidden".

that should normally be enough not to show them to clients... certainly prevents them appear on a quick dev test...

11 hours ago, jacksony said:

But the strange thing is when logging as customers, they still can select these as add-ons for the services.

you might have to go in the product addons setup, and work your way your through theme MC addons and remove the relevant hosting products "Applicable Products" list...

I can't help thinking you shouldn't have to do this, but it should be a reliable way to remove them as an option from the client area for existing clients.

Link to comment
Share on other sites

10 hours ago, jacksony said:

It is too tedious to remove all the MarketConnect product addons which we don't use.

you could run a SQL query on tbladdons to null the 'packages' field for marketconnect type products - an addon not associated with a product shouldn't be able to be ordered.. e.g there is nothing to add it on to.

10 hours ago, jacksony said:

Is it safe to remove all product addons which are generated by MarketConnect if we don't use them?

I can't see why not - though there's no guarantee that a future release wouldn't add them back... now I wouldn't expect that to happen unless a brand was enabled in settings, but there's no guarantees.

Link to comment
Share on other sites

8 hours ago, jacksony said:

Yes it is really very strange, even in tbladdons, all these not-used marketconnect services also has "hidden" set to 1. But they are still being show to customers as add-on.

any chance that there is an addon / hook causing this behaviour ?

if you *had* to, you could use a hook to remove marketconnect addons from the page - base don the hook in the thread below...

<?php

# Block MC Addons Hook
# Written by brian!

use WHMCS\Database\Capsule;
 
function cart_block_mc_addons($vars) {
	
	if ($vars['templatefile']=='addons'){
		$mcaddons = Capsule::table('tbladdons')->where('module','marketconnect')->pluck('id')->all();
		$addons = $vars['addons'];
		foreach ($addons as $key => $addon) {
			if (in_array($addon['id'],$mcaddons)) {
				unset($addons[$key]);
			}
		}
		$addons = array_values($addons);
		return array("addons" => $addons);
	}
}
add_hook("ClientAreaPageCart", 1, "cart_block_mc_addons");

the above hook queries the database for a list of MC addons and removes those addons from being shown to the client - it won't affect new addons being ordered with services during the normal ordering process.

however, I would suggest first checking that there isn't a hook/addon causing this before employing the above hook. 🙂

Link to comment
Share on other sites

Yep there is no hook affecting this. Seems to be a bug.

Even more, there is bug for the order of the addons. As we realised it was sorted (customer's display) based on the ID instead of showorder.

Sigh. Anymore removing the MC's unused addons fixed the problem.

Link to comment
Share on other sites

11 hours ago, jacksony said:

Even more, there is bug for the order of the addons. As we realised it was sorted (customer's display) based on the ID instead of showorder.

they should be sorted by weighting and then alphabetically - if you have addons that have the same weighting, then it can look entirely random with addons scattered all over the place.

Edited by brian!
Link to comment
Share on other sites

As brian has mentioned above, you have to enable it at least once for the addons to get created, so you must have done so in the past.

But disabling the product in marketplace, annoyingly,  does not get rid of those addons, you have to do this manually.

Going into the addon and unassigning all the applicable products would be the quickest temp solution if hiding them is not working.
Or just delete them.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated