Source of file CheckoutStep.php
Size: 1,152 Bytes - Last Modified: 2021-12-24T06:35:03+00:00
/var/www/docs.ssmods.com/process/src/src/Checkout/Step/CheckoutStep.php
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 | <?php namespace SilverShop\Checkout\Step; use SilverShop\Extension\SteppedCheckoutExtension; use SilverStripe\Core\Config\Config; use SilverStripe\Core\Config\Configurable; use SilverStripe\Core\Extension; /** * Base class for building steps for checkout processing */ class CheckoutStep extends Extension { use Configurable; /** * Get the next step action * * @return string|NULL */ private function nextstep() { $steps = $this->owner->getSteps(); $found = false; foreach ($steps as $step => $class) { //determine if this is the current step if (method_exists($this, $step)) { $found = true; } elseif ($found) { return $step; } } return null; } public function NextStepLink($nextstep = null) { if (!$nextstep) { $nextstep = $this->nextstep(); } $anchor = Config::inst()->get(SteppedCheckoutExtension::class, 'continue_anchor'); $anchor = $anchor ? '#' . $anchor : ''; return $this->owner->Link($nextstep) . $anchor; } } |