mirror of
https://github.com/openclassify/openclassify.git
synced 2026-02-10 07:16:06 -06:00
#4080 add to cart problem
This commit is contained in:
parent
36b9766e7f
commit
034747bd6a
@ -14,10 +14,25 @@ use Visiosoft\CartsModule\Cart\Command\GetCart;
|
|||||||
use Visiosoft\LocationModule\District\DistrictModel;
|
use Visiosoft\LocationModule\District\DistrictModel;
|
||||||
use Visiosoft\LocationModule\Neighborhood\NeighborhoodModel;
|
use Visiosoft\LocationModule\Neighborhood\NeighborhoodModel;
|
||||||
use Visiosoft\LocationModule\Village\Contract\VillageRepositoryInterface;
|
use Visiosoft\LocationModule\Village\Contract\VillageRepositoryInterface;
|
||||||
use Visiosoft\LocationModule\Village\VillageModel;
|
|
||||||
|
|
||||||
class AdvModel extends AdvsAdvsEntryModel implements AdvInterface
|
class AdvModel extends AdvsAdvsEntryModel implements AdvInterface
|
||||||
{
|
{
|
||||||
|
public function getTransNameAttribute()
|
||||||
|
{
|
||||||
|
if (is_null($this->name)) {
|
||||||
|
$ad = DB::table('advs_advs')
|
||||||
|
->join('advs_advs_translations', 'advs_advs.id', '=', 'entry_id')
|
||||||
|
->select('name')
|
||||||
|
->where('advs_advs.id', $this->id)
|
||||||
|
->whereNotNull('name')
|
||||||
|
->first();
|
||||||
|
|
||||||
|
return $ad ? $ad->name : '-';
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->name;
|
||||||
|
}
|
||||||
|
|
||||||
public function is_enabled($slug)
|
public function is_enabled($slug)
|
||||||
{
|
{
|
||||||
if ($addon = app('module.collection')->get($slug)) {
|
if ($addon = app('module.collection')->get($slug)) {
|
||||||
|
|||||||
@ -4,6 +4,8 @@ use Anomaly\Streams\Platform\Entry\Contract\EntryInterface;
|
|||||||
|
|
||||||
interface AdvInterface extends EntryInterface
|
interface AdvInterface extends EntryInterface
|
||||||
{
|
{
|
||||||
|
public function getTransNameAttribute();
|
||||||
|
|
||||||
public function is_enabled($slug);
|
public function is_enabled($slug);
|
||||||
|
|
||||||
public function is_enabled_extension($slug);
|
public function is_enabled_extension($slug);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user