MarketPress with terms of use and disclaimer acceptance

Hi,
I've installed marketpreass. Basically it's working fine. But how can I force the user to accept disclaimer and terms of use.
You can see the shop here:
http://egraf.de.server49.vorschauseite.eu/shop-mr/
But I've found no setting where user can order only when terms of use and disclaimers are accepted.

Help will be really appreciated.
THanks a lot !
Michael

  • Vaughan

    Hi @michael,

    Currently marketpress does not have this functionality.

    There are terms & conditions plugins which attach to the registration system so a user needs to accept the TOS before they can submit their registration, but there isn't anything for adding this to purchasing products.

    I can certainly add this as a feature request for the developers to look into adding in a future release, however I wouldn't be able to give an ETA on when it could be included.

    Hope this helps

  • Michael

    Hi Vaughan,
    now I just tried to do it by myself. But something doesn't worked at a simple form check. Don't know the reason.
    Simple Idea was to put in template functions.php round line 953
    $_SESSION['agbcheck'] = '';
    $content .= '<input type=@Ashokcheckbox" name="agbcheck" value="ok" ' . checked($_SESSION['agbcheck']) . '/>Datenschutz und gesetzliche Bestimmungen akzeptieren.
    </input>';

    And extend the if
    if (empty($_SESSION['mp_payment_method'])) {
    with
    if (empty($_SESSION['mp_payment_method']) || $_SESSION['agbcheck'] <> "ok") {

    But everytime is false....if you could support me how to realize this basical simply idea.

    The effect is, that it has the same status as skipped payment.
    But I can update the text and then he has to go back.

    Your support would be really valuable!
    Greetings
    Michael

  • Michael

    Hi Jonathan,
    thanks for kind support. I know that I set this. This is to initialise the variable.
    I marked as a comment but with no effect.

    I'm really lost where the problem is. Just tried more than two hours today to get it run. I past you the complete code. Perhaps you see the problem...or do I have to consider something script internal things that prevent this to work ?

    You're help is really needed and would be very very welcome.

    Thanks a ton in advance!
    Michael

    if ($type == 'form') {
            $content = '<form id="mp_payment_form" method="post" action="' . mp_checkout_step_url('checkout') . '">';
    
    				if (count((array) $mp_gateway_active_plugins) == 1) {
    						$content .= '<input type="hidden" name="mp_choose_gateway" value="' . $mp_gateway_active_plugins[0]->plugin_name . '" />';
    				} else if (count((array) $mp_gateway_active_plugins) > 1) {
    						$content .= '<table class="mp_cart_payment_methods">';
    						$content .= '<thead><tr>';
    						$content .= '<th>' . __('Choose a Payment Method:', 'mp') . '</th>';
    						$content .= '</tr></thead>';
    						$content .= '<tbody><tr><td>';
    						foreach ((array) $mp_gateway_active_plugins as $plugin) {
    								$content .= '<label>';
    								$content .= '<input type="radio" class="mp_choose_gateway" name="mp_choose_gateway" value="' . $plugin->plugin_name . '" ' . checked($_SESSION['mp_payment_method'], $plugin->plugin_name, false) . '/>';
    								if ($plugin->method_img_url) {
    										$content .= '<img src="' . $plugin->method_img_url . '" alt="' . $plugin->public_name . '" />';
    								}
    								$content .= $plugin->public_name;
    								$content .= '</label>';
    						}
              // $_SESSION['agbcheck']   = '';
               $content .= '<input type="checkbox"  name="agbcheck" value="ok" ' . checked($_SESSION['agbcheck']) . '/><a href="http://egraf.de.server49.vorschauseite.eu/datenschutz-eveline-graf/" target="_blank">Datenschutz und gesetzliche Bestimmungen akzeptieren.<br></input>';
    
    						$content .= '</td>';
    						$content .= '</tr>';
    						$content .= '</tbody>';
    						$content .= '</table>';
    				}
    
    				$content .= apply_filters('mp_checkout_payment_form', '', $cart, $_SESSION['mp_shipping_info']);
    
    				$content .= '</form>';
    		} else if ($type == 'confirm' ) {
           if($_SESSION['agbcheck'] == "ok"){
             echo "checked<br>" . $_SESSION['agbcheck'] . "|jjjj";
            } else {
             echo "Sorry, du musst die Regeln aktzeptieren<br>" . $_SESSION['agbcheck'] . "|nnnnnnnn";
            }
    				//if skipping a step
            echo 'agbchek:'. $_SESSION['agbcheck'] . '|';
    				if (empty($_SESSION['mp_payment_method']) || $_SESSION['agbcheck'] <> 'ok') {
  • Michael

    Hi Jonathan,

    thanks a lot for your response and help. I tried out immediately. First I had to find where you mean, In production I have 2.9.1 and at staging 2.9.03.

    I think I found the right place. At the new version there are some initilations:

    //save to session
    		global $current_user;
    		$meta = get_user_meta($current_user->ID, 'mp_shipping_info', true);
    		$_SESSION['mp_shipping_info']['email'] = isset($_POST['email']) ? trim(stripslashes($_POST['email'])) : (isset($meta['email']) ? $meta['email']: $current_user->user_email);
    		$_SESSION['mp_shipping_info']['name'] = isset($_POST['name']) ? trim(stripslashes($_POST['name'])) : (isset($meta['name']) ? $meta['name'] : $current_user->user_firstname . ' ' . $current_user->user_lastname);
    		$_SESSION['mp_shipping_info']['address1'] = isset($_POST['address1']) ? trim(stripslashes($_POST['address1'])) : $meta['address1'];
    		$_SESSION['mp_shipping_info']['address2'] = isset($_POST['address2']) ? trim(stripslashes($_POST['address2'])) : $meta['address2'];
    		$_SESSION['mp_shipping_info']['city'] = isset($_POST['city']) ? trim(stripslashes($_POST['city'])) : $meta['city'];
    		$_SESSION['mp_shipping_info']['state'] = isset($_POST['state']) ? trim(stripslashes($_POST['state'])) : $meta['state'];
    		$_SESSION['mp_shipping_info']['zip'] = isset($_POST['zip']) ? trim(stripslashes($_POST['zip'])) : $meta['zip'];
    		$_SESSION['mp_shipping_info']['country'] = isset($_POST['country']) ? trim($_POST['country']) : $meta['country'];
    		$_SESSION['mp_shipping_info']['phone'] = isset($_POST['phone']) ? preg_replace('/[^0-9-\(\) ]/', '', trim($_POST['phone'])) : $meta['phone'];
        $_SESSION['agbcheck'] = isset($_POST['agbcheck']) ? $_POST['agbcheck'] : '';

    Here I also added the line. But also with this update my test failes.

    So at template functions I have still these two littel code parts:

    foreach ((array) $mp_gateway_active_plugins as $plugin) {
    								$content .= '<label>';
    								$content .= '<input type="radio" class="mp_choose_gateway" name="mp_choose_gateway" value="' . $plugin->plugin_name . '" ' . checked($_SESSION['mp_payment_method'], $plugin->plugin_name, false) . '/>';
    								if ($plugin->method_img_url) {
    										$content .= '<img src="' . $plugin->method_img_url . '" alt="' . $plugin->public_name . '" />';
    								}
    								$content .= $plugin->public_name;
    								$content .= '</label>';
    						}
              // $_SESSION['agbcheck']   = '';
               $content .= '<input type="checkbox"  name="agbcheck" value="ok" ' . checked($_SESSION['agbcheck']) . '/><a href="http://egraf.de.server49.vorschauseite.eu/datenschutz-eveline-graf/" target="_blank">Datenschutz und gesetzliche Bestimmungen akzeptieren.<br></input>';

    After the foreach at round 944 in old version added the input filed.
    And one step further first I want to see the content of the varialbe:

    } else if ($type == 'confirm' ) {
           if($_SESSION['agbcheck'] == "ok"){
             echo "checked:" . $_SESSION['agbcheck'] . "|<br>";
            } else {
             echo "Sorry, du musst die Regeln aktzeptieren:" . $_SESSION['agbcheck'] . "|<br>";
            }
    				//if skipping a step
            echo 'agbchek:'. $_SESSION['agbcheck'] . '|';
    				if (empty($_SESSION['mp_payment_method']) || $_SESSION['agbcheck'] <> 'ok') {
    						$content .= '<div class="mp_checkout_error">' . sprintf(__('Whoops, looks like you skipped a step! Please <a href="%s">go back and try again</a>.', 'mp'), mp_checkout_step_url('checkout')) . '</div>';
    						return $content;
    				}

    And then check for the content. But still empty.
    You can also test it on staging: http://egraf.de.server49.vorschauseite.eu/shop-mr/

    Any further hint will be really welcome !!
    Thanks a very very lot for your support.

    Greetings
    Michael

  • Michael

    Hi Jonathan,
    yes now I see the difference at the 'ok'. I put it following your suggesttion. But withouth any result.

    Normally it's not so difficult to insert a simple checkbox and transfer it via session to the next page. But my knowledge is also no a real expert.

    So if you have any further suggestion it would be great. Without this little extension it's really difficult to fit the laws in germany.

    THanks a lot in advance!
    MIchael