mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -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\Neighborhood\NeighborhoodModel;
|
||||
use Visiosoft\LocationModule\Village\Contract\VillageRepositoryInterface;
|
||||
use Visiosoft\LocationModule\Village\VillageModel;
|
||||
|
||||
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)
|
||||
{
|
||||
if ($addon = app('module.collection')->get($slug)) {
|
||||
|
||||
@ -4,6 +4,8 @@ use Anomaly\Streams\Platform\Entry\Contract\EntryInterface;
|
||||
|
||||
interface AdvInterface extends EntryInterface
|
||||
{
|
||||
public function getTransNameAttribute();
|
||||
|
||||
public function is_enabled($slug);
|
||||
|
||||
public function is_enabled_extension($slug);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user