How to get recently viewed products collection of Customer Magento 2?Get recently viewed products programmatically in Magento 2.2.2Magento 2 How to get recently view product collectionMagento 2 shows current product as recently viewed productMagento 2.2.0 - Display Recently Viewed Products block on Product Detail pageturpentine for varnish recently viewed products not working(Solved) How to reach “add to cart” button and price inside Recently Viewed Products Widget in magento 2keep recently viewed products for guest usersMagento 2: how to Get Customer Recently viewed product collectionMagento 2.2: How to remove add_to_wishlist button from, and add SKU view in, recently viewed products widget in moduleGet recently viewed products excluding particular product ID in Magento 2Magento 1.9 Save recently viewed products in cookieMagento 2 - Recently viewed product collection from Model

I know that there is a preselected candidate for a position to be filled at my department. What should I do?

Is the Indo-European language family made up?

Grammar Question Regarding "Are the" or "Is the" When Referring to Something that May or May not be Plural

What does the view outside my ship traveling at light speed look like?

Python program to take in two strings and print the larger string

In general, would I need to season a meat when making a sauce?

What is a really good book for complex variables?

Construct a word ladder

Where's this lookout in Nova Scotia?

Why are C64 games inconsistent with which joystick port they use?

what kind of chord progession is this?

Teacher help me explain this to my students

Inconsistent results from Wolfram Could

Does Nitrogen inside commercial airliner wheels prevent blowouts on touchdown?

What is the object moving across the ceiling in this stock footage?

Should breaking down something like a door be adjudicated as an attempt to beat its AC and HP, or as an ability check against a set DC?

Can I tell a prospective employee that everyone in the team is leaving?

What is a Centaur Thief's climbing speed?

Should I disclose a colleague's illness (that I should not know) when others badmouth him

Do photons bend spacetime or not?

Where can I find visible/radio telescopic observations of the center of the Milky Way galaxy?

Could a 19.25mm revolver actually exist?

Are these reasonable traits for someone with autism?

Compaq Portable vs IBM 5155 Portable PC



How to get recently viewed products collection of Customer Magento 2?


Get recently viewed products programmatically in Magento 2.2.2Magento 2 How to get recently view product collectionMagento 2 shows current product as recently viewed productMagento 2.2.0 - Display Recently Viewed Products block on Product Detail pageturpentine for varnish recently viewed products not working(Solved) How to reach “add to cart” button and price inside Recently Viewed Products Widget in magento 2keep recently viewed products for guest usersMagento 2: how to Get Customer Recently viewed product collectionMagento 2.2: How to remove add_to_wishlist button from, and add SKU view in, recently viewed products widget in moduleGet recently viewed products excluding particular product ID in Magento 2Magento 1.9 Save recently viewed products in cookieMagento 2 - Recently viewed product collection from Model






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








2
















Magento 2 get recently viewed products collection of Customer (Using customer ID) programmatically




I tried this solution But I want recently viewed products collection.



I tried below solution too but it is not returning anything. [I am logged in]



protected $recentlyViewed;

public function __construct(
...
MagentoReportsBlockProductViewed $recentlyViewed
)
...
$this->recentlyViewed = $recentlyViewed;


/**
* Get recently viewed products for the customer
*
*/
public function getMostRecentlyViewed()
return $this->recentlyViewed->getItemsCollection();










share|improve this question
























  • I added code in chat box.

    – Rohan Hapani
    Nov 26 '18 at 17:27

















2
















Magento 2 get recently viewed products collection of Customer (Using customer ID) programmatically




I tried this solution But I want recently viewed products collection.



I tried below solution too but it is not returning anything. [I am logged in]



protected $recentlyViewed;

public function __construct(
...
MagentoReportsBlockProductViewed $recentlyViewed
)
...
$this->recentlyViewed = $recentlyViewed;


/**
* Get recently viewed products for the customer
*
*/
public function getMostRecentlyViewed()
return $this->recentlyViewed->getItemsCollection();










share|improve this question
























  • I added code in chat box.

    – Rohan Hapani
    Nov 26 '18 at 17:27













2












2








2









Magento 2 get recently viewed products collection of Customer (Using customer ID) programmatically




I tried this solution But I want recently viewed products collection.



I tried below solution too but it is not returning anything. [I am logged in]



protected $recentlyViewed;

public function __construct(
...
MagentoReportsBlockProductViewed $recentlyViewed
)
...
$this->recentlyViewed = $recentlyViewed;


/**
* Get recently viewed products for the customer
*
*/
public function getMostRecentlyViewed()
return $this->recentlyViewed->getItemsCollection();










share|improve this question

















Magento 2 get recently viewed products collection of Customer (Using customer ID) programmatically




I tried this solution But I want recently viewed products collection.



I tried below solution too but it is not returning anything. [I am logged in]



protected $recentlyViewed;

public function __construct(
...
MagentoReportsBlockProductViewed $recentlyViewed
)
...
$this->recentlyViewed = $recentlyViewed;


/**
* Get recently viewed products for the customer
*
*/
public function getMostRecentlyViewed()
return $this->recentlyViewed->getItemsCollection();







magento2 product-collection recently-viewed






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 26 '18 at 5:57







Aaditya

















asked Nov 25 '18 at 10:28









AadityaAaditya

4,74021243




4,74021243












  • I added code in chat box.

    – Rohan Hapani
    Nov 26 '18 at 17:27

















  • I added code in chat box.

    – Rohan Hapani
    Nov 26 '18 at 17:27
















I added code in chat box.

– Rohan Hapani
Nov 26 '18 at 17:27





I added code in chat box.

– Rohan Hapani
Nov 26 '18 at 17:27










2 Answers
2






active

oldest

votes


















4














Try to use this code :



Method 1 :



/**
* Layout
* @var MagentoFrameworkViewLayoutInterface
*/

protected $_layout;

public function __construct(
.....
MagentoFrameworkViewLayoutInterface $layout
.......
)
$this->_layout = $layout;


public function getMyCollection()
$block = $this->_layout->getBlockSingleton(MagentoReportsBlockProductViewed::class)->getItemsCollection();
return $block;



UPDATE :



Method 2 :



You need to load ItemCollection() after get collection like below way :



protected $recentlyViewed;

public function __construct(
MagentoReportsBlockProductViewed $recentlyViewed
)
$this->recentlyViewed = $recentlyViewed;


public function execute()
$collection = $this->recentlyViewed->getItemsCollection()->load();
echo "<pre>";
print_r($collection->getData());
exit;






share|improve this answer




















  • 1





    Thanks bro :) Definitely try this tomorrow morning !

    – Aaditya
    Nov 25 '18 at 14:00






  • 1





    Sure :) If not working then you can update here..

    – Rohan Hapani
    Nov 25 '18 at 14:02











  • Not working @Rohan

    – Aaditya
    Nov 26 '18 at 5:43






  • 1





    Try to use this second method.. it's working from my side so.

    – Rohan Hapani
    Nov 26 '18 at 6:18











  • Okay bro :) trying *

    – Aaditya
    Nov 26 '18 at 6:19


















2














Please try below code, I tested the same and found it working:



<?php 
namespace YourPackageYourModuleBlockRecentlyViewed;

class Test extends MagentoFrameworkViewElementTemplate

protected $recentlyViewed;

public function __construct(
MagentoFrameworkViewElementTemplateContext $context,
MagentoReportsBlockProductViewed $recentlyViewed,
array $data = []
)
$this->recentlyViewed = $recentlyViewed;
parent::__construct( $context, $data );


public function getMostRecentlyViewed()
return $this->recentlyViewed->getItemsCollection()->getData();




and call this block in required file, cms page or static block, for example if you wan to add this block to home page than add below code:




block class="YourPackageYourModuleBlockRecentlyViewedTest"
name="block_recently_viewed"
template="YourPackage_YourModule::test.phtml"




In test.phtml file you can get the collection and design it in your way, I just tested by printing the collection and it was printing correctly.



test.phtml



<?php echo "<pre>"; print_r($this->getMostRecentlyViewed()); ?>


Note : Please note that the collection will be empty if you don't visits any page as the collection is of recently viewed product by you. Visit some products at your store and you will get the collection being populated.






share|improve this answer























  • Is it possible without accessing parent ?

    – Aaditya
    Nov 26 '18 at 5:43











  • without extends MagentoFrameworkViewElementTemplate

    – Aaditya
    Nov 26 '18 at 5:43











  • No, it would create issue as we need to Abstract class for frontend representational purpose :), We need to create similar abstract class if you don't want to extend it but that is meaningless effort. Its good to extend the existing available Abstract class..

    – Himmat Paliwal
    Nov 26 '18 at 5:59












  • Okay and If i extend that class _ I want customers collection

    – Aaditya
    Nov 26 '18 at 6:00











  • And I want all this in Model file that's why I asked that I need collection for that :)

    – Aaditya
    Nov 26 '18 at 6:01











Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f251219%2fhow-to-get-recently-viewed-products-collection-of-customer-magento-2%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









4














Try to use this code :



Method 1 :



/**
* Layout
* @var MagentoFrameworkViewLayoutInterface
*/

protected $_layout;

public function __construct(
.....
MagentoFrameworkViewLayoutInterface $layout
.......
)
$this->_layout = $layout;


public function getMyCollection()
$block = $this->_layout->getBlockSingleton(MagentoReportsBlockProductViewed::class)->getItemsCollection();
return $block;



UPDATE :



Method 2 :



You need to load ItemCollection() after get collection like below way :



protected $recentlyViewed;

public function __construct(
MagentoReportsBlockProductViewed $recentlyViewed
)
$this->recentlyViewed = $recentlyViewed;


public function execute()
$collection = $this->recentlyViewed->getItemsCollection()->load();
echo "<pre>";
print_r($collection->getData());
exit;






share|improve this answer




















  • 1





    Thanks bro :) Definitely try this tomorrow morning !

    – Aaditya
    Nov 25 '18 at 14:00






  • 1





    Sure :) If not working then you can update here..

    – Rohan Hapani
    Nov 25 '18 at 14:02











  • Not working @Rohan

    – Aaditya
    Nov 26 '18 at 5:43






  • 1





    Try to use this second method.. it's working from my side so.

    – Rohan Hapani
    Nov 26 '18 at 6:18











  • Okay bro :) trying *

    – Aaditya
    Nov 26 '18 at 6:19















4














Try to use this code :



Method 1 :



/**
* Layout
* @var MagentoFrameworkViewLayoutInterface
*/

protected $_layout;

public function __construct(
.....
MagentoFrameworkViewLayoutInterface $layout
.......
)
$this->_layout = $layout;


public function getMyCollection()
$block = $this->_layout->getBlockSingleton(MagentoReportsBlockProductViewed::class)->getItemsCollection();
return $block;



UPDATE :



Method 2 :



You need to load ItemCollection() after get collection like below way :



protected $recentlyViewed;

public function __construct(
MagentoReportsBlockProductViewed $recentlyViewed
)
$this->recentlyViewed = $recentlyViewed;


public function execute()
$collection = $this->recentlyViewed->getItemsCollection()->load();
echo "<pre>";
print_r($collection->getData());
exit;






share|improve this answer




















  • 1





    Thanks bro :) Definitely try this tomorrow morning !

    – Aaditya
    Nov 25 '18 at 14:00






  • 1





    Sure :) If not working then you can update here..

    – Rohan Hapani
    Nov 25 '18 at 14:02











  • Not working @Rohan

    – Aaditya
    Nov 26 '18 at 5:43






  • 1





    Try to use this second method.. it's working from my side so.

    – Rohan Hapani
    Nov 26 '18 at 6:18











  • Okay bro :) trying *

    – Aaditya
    Nov 26 '18 at 6:19













4












4








4







Try to use this code :



Method 1 :



/**
* Layout
* @var MagentoFrameworkViewLayoutInterface
*/

protected $_layout;

public function __construct(
.....
MagentoFrameworkViewLayoutInterface $layout
.......
)
$this->_layout = $layout;


public function getMyCollection()
$block = $this->_layout->getBlockSingleton(MagentoReportsBlockProductViewed::class)->getItemsCollection();
return $block;



UPDATE :



Method 2 :



You need to load ItemCollection() after get collection like below way :



protected $recentlyViewed;

public function __construct(
MagentoReportsBlockProductViewed $recentlyViewed
)
$this->recentlyViewed = $recentlyViewed;


public function execute()
$collection = $this->recentlyViewed->getItemsCollection()->load();
echo "<pre>";
print_r($collection->getData());
exit;






share|improve this answer















Try to use this code :



Method 1 :



/**
* Layout
* @var MagentoFrameworkViewLayoutInterface
*/

protected $_layout;

public function __construct(
.....
MagentoFrameworkViewLayoutInterface $layout
.......
)
$this->_layout = $layout;


public function getMyCollection()
$block = $this->_layout->getBlockSingleton(MagentoReportsBlockProductViewed::class)->getItemsCollection();
return $block;



UPDATE :



Method 2 :



You need to load ItemCollection() after get collection like below way :



protected $recentlyViewed;

public function __construct(
MagentoReportsBlockProductViewed $recentlyViewed
)
$this->recentlyViewed = $recentlyViewed;


public function execute()
$collection = $this->recentlyViewed->getItemsCollection()->load();
echo "<pre>";
print_r($collection->getData());
exit;







share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 26 '18 at 6:18

























answered Nov 25 '18 at 13:58









Rohan HapaniRohan Hapani

1




1







  • 1





    Thanks bro :) Definitely try this tomorrow morning !

    – Aaditya
    Nov 25 '18 at 14:00






  • 1





    Sure :) If not working then you can update here..

    – Rohan Hapani
    Nov 25 '18 at 14:02











  • Not working @Rohan

    – Aaditya
    Nov 26 '18 at 5:43






  • 1





    Try to use this second method.. it's working from my side so.

    – Rohan Hapani
    Nov 26 '18 at 6:18











  • Okay bro :) trying *

    – Aaditya
    Nov 26 '18 at 6:19












  • 1





    Thanks bro :) Definitely try this tomorrow morning !

    – Aaditya
    Nov 25 '18 at 14:00






  • 1





    Sure :) If not working then you can update here..

    – Rohan Hapani
    Nov 25 '18 at 14:02











  • Not working @Rohan

    – Aaditya
    Nov 26 '18 at 5:43






  • 1





    Try to use this second method.. it's working from my side so.

    – Rohan Hapani
    Nov 26 '18 at 6:18











  • Okay bro :) trying *

    – Aaditya
    Nov 26 '18 at 6:19







1




1





Thanks bro :) Definitely try this tomorrow morning !

– Aaditya
Nov 25 '18 at 14:00





Thanks bro :) Definitely try this tomorrow morning !

– Aaditya
Nov 25 '18 at 14:00




1




1





Sure :) If not working then you can update here..

– Rohan Hapani
Nov 25 '18 at 14:02





Sure :) If not working then you can update here..

– Rohan Hapani
Nov 25 '18 at 14:02













Not working @Rohan

– Aaditya
Nov 26 '18 at 5:43





Not working @Rohan

– Aaditya
Nov 26 '18 at 5:43




1




1





Try to use this second method.. it's working from my side so.

– Rohan Hapani
Nov 26 '18 at 6:18





Try to use this second method.. it's working from my side so.

– Rohan Hapani
Nov 26 '18 at 6:18













Okay bro :) trying *

– Aaditya
Nov 26 '18 at 6:19





Okay bro :) trying *

– Aaditya
Nov 26 '18 at 6:19













2














Please try below code, I tested the same and found it working:



<?php 
namespace YourPackageYourModuleBlockRecentlyViewed;

class Test extends MagentoFrameworkViewElementTemplate

protected $recentlyViewed;

public function __construct(
MagentoFrameworkViewElementTemplateContext $context,
MagentoReportsBlockProductViewed $recentlyViewed,
array $data = []
)
$this->recentlyViewed = $recentlyViewed;
parent::__construct( $context, $data );


public function getMostRecentlyViewed()
return $this->recentlyViewed->getItemsCollection()->getData();




and call this block in required file, cms page or static block, for example if you wan to add this block to home page than add below code:




block class="YourPackageYourModuleBlockRecentlyViewedTest"
name="block_recently_viewed"
template="YourPackage_YourModule::test.phtml"




In test.phtml file you can get the collection and design it in your way, I just tested by printing the collection and it was printing correctly.



test.phtml



<?php echo "<pre>"; print_r($this->getMostRecentlyViewed()); ?>


Note : Please note that the collection will be empty if you don't visits any page as the collection is of recently viewed product by you. Visit some products at your store and you will get the collection being populated.






share|improve this answer























  • Is it possible without accessing parent ?

    – Aaditya
    Nov 26 '18 at 5:43











  • without extends MagentoFrameworkViewElementTemplate

    – Aaditya
    Nov 26 '18 at 5:43











  • No, it would create issue as we need to Abstract class for frontend representational purpose :), We need to create similar abstract class if you don't want to extend it but that is meaningless effort. Its good to extend the existing available Abstract class..

    – Himmat Paliwal
    Nov 26 '18 at 5:59












  • Okay and If i extend that class _ I want customers collection

    – Aaditya
    Nov 26 '18 at 6:00











  • And I want all this in Model file that's why I asked that I need collection for that :)

    – Aaditya
    Nov 26 '18 at 6:01















2














Please try below code, I tested the same and found it working:



<?php 
namespace YourPackageYourModuleBlockRecentlyViewed;

class Test extends MagentoFrameworkViewElementTemplate

protected $recentlyViewed;

public function __construct(
MagentoFrameworkViewElementTemplateContext $context,
MagentoReportsBlockProductViewed $recentlyViewed,
array $data = []
)
$this->recentlyViewed = $recentlyViewed;
parent::__construct( $context, $data );


public function getMostRecentlyViewed()
return $this->recentlyViewed->getItemsCollection()->getData();




and call this block in required file, cms page or static block, for example if you wan to add this block to home page than add below code:




block class="YourPackageYourModuleBlockRecentlyViewedTest"
name="block_recently_viewed"
template="YourPackage_YourModule::test.phtml"




In test.phtml file you can get the collection and design it in your way, I just tested by printing the collection and it was printing correctly.



test.phtml



<?php echo "<pre>"; print_r($this->getMostRecentlyViewed()); ?>


Note : Please note that the collection will be empty if you don't visits any page as the collection is of recently viewed product by you. Visit some products at your store and you will get the collection being populated.






share|improve this answer























  • Is it possible without accessing parent ?

    – Aaditya
    Nov 26 '18 at 5:43











  • without extends MagentoFrameworkViewElementTemplate

    – Aaditya
    Nov 26 '18 at 5:43











  • No, it would create issue as we need to Abstract class for frontend representational purpose :), We need to create similar abstract class if you don't want to extend it but that is meaningless effort. Its good to extend the existing available Abstract class..

    – Himmat Paliwal
    Nov 26 '18 at 5:59












  • Okay and If i extend that class _ I want customers collection

    – Aaditya
    Nov 26 '18 at 6:00











  • And I want all this in Model file that's why I asked that I need collection for that :)

    – Aaditya
    Nov 26 '18 at 6:01













2












2








2







Please try below code, I tested the same and found it working:



<?php 
namespace YourPackageYourModuleBlockRecentlyViewed;

class Test extends MagentoFrameworkViewElementTemplate

protected $recentlyViewed;

public function __construct(
MagentoFrameworkViewElementTemplateContext $context,
MagentoReportsBlockProductViewed $recentlyViewed,
array $data = []
)
$this->recentlyViewed = $recentlyViewed;
parent::__construct( $context, $data );


public function getMostRecentlyViewed()
return $this->recentlyViewed->getItemsCollection()->getData();




and call this block in required file, cms page or static block, for example if you wan to add this block to home page than add below code:




block class="YourPackageYourModuleBlockRecentlyViewedTest"
name="block_recently_viewed"
template="YourPackage_YourModule::test.phtml"




In test.phtml file you can get the collection and design it in your way, I just tested by printing the collection and it was printing correctly.



test.phtml



<?php echo "<pre>"; print_r($this->getMostRecentlyViewed()); ?>


Note : Please note that the collection will be empty if you don't visits any page as the collection is of recently viewed product by you. Visit some products at your store and you will get the collection being populated.






share|improve this answer













Please try below code, I tested the same and found it working:



<?php 
namespace YourPackageYourModuleBlockRecentlyViewed;

class Test extends MagentoFrameworkViewElementTemplate

protected $recentlyViewed;

public function __construct(
MagentoFrameworkViewElementTemplateContext $context,
MagentoReportsBlockProductViewed $recentlyViewed,
array $data = []
)
$this->recentlyViewed = $recentlyViewed;
parent::__construct( $context, $data );


public function getMostRecentlyViewed()
return $this->recentlyViewed->getItemsCollection()->getData();




and call this block in required file, cms page or static block, for example if you wan to add this block to home page than add below code:




block class="YourPackageYourModuleBlockRecentlyViewedTest"
name="block_recently_viewed"
template="YourPackage_YourModule::test.phtml"




In test.phtml file you can get the collection and design it in your way, I just tested by printing the collection and it was printing correctly.



test.phtml



<?php echo "<pre>"; print_r($this->getMostRecentlyViewed()); ?>


Note : Please note that the collection will be empty if you don't visits any page as the collection is of recently viewed product by you. Visit some products at your store and you will get the collection being populated.







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 25 '18 at 16:09









Himmat PaliwalHimmat Paliwal

1,256419




1,256419












  • Is it possible without accessing parent ?

    – Aaditya
    Nov 26 '18 at 5:43











  • without extends MagentoFrameworkViewElementTemplate

    – Aaditya
    Nov 26 '18 at 5:43











  • No, it would create issue as we need to Abstract class for frontend representational purpose :), We need to create similar abstract class if you don't want to extend it but that is meaningless effort. Its good to extend the existing available Abstract class..

    – Himmat Paliwal
    Nov 26 '18 at 5:59












  • Okay and If i extend that class _ I want customers collection

    – Aaditya
    Nov 26 '18 at 6:00











  • And I want all this in Model file that's why I asked that I need collection for that :)

    – Aaditya
    Nov 26 '18 at 6:01

















  • Is it possible without accessing parent ?

    – Aaditya
    Nov 26 '18 at 5:43











  • without extends MagentoFrameworkViewElementTemplate

    – Aaditya
    Nov 26 '18 at 5:43











  • No, it would create issue as we need to Abstract class for frontend representational purpose :), We need to create similar abstract class if you don't want to extend it but that is meaningless effort. Its good to extend the existing available Abstract class..

    – Himmat Paliwal
    Nov 26 '18 at 5:59












  • Okay and If i extend that class _ I want customers collection

    – Aaditya
    Nov 26 '18 at 6:00











  • And I want all this in Model file that's why I asked that I need collection for that :)

    – Aaditya
    Nov 26 '18 at 6:01
















Is it possible without accessing parent ?

– Aaditya
Nov 26 '18 at 5:43





Is it possible without accessing parent ?

– Aaditya
Nov 26 '18 at 5:43













without extends MagentoFrameworkViewElementTemplate

– Aaditya
Nov 26 '18 at 5:43





without extends MagentoFrameworkViewElementTemplate

– Aaditya
Nov 26 '18 at 5:43













No, it would create issue as we need to Abstract class for frontend representational purpose :), We need to create similar abstract class if you don't want to extend it but that is meaningless effort. Its good to extend the existing available Abstract class..

– Himmat Paliwal
Nov 26 '18 at 5:59






No, it would create issue as we need to Abstract class for frontend representational purpose :), We need to create similar abstract class if you don't want to extend it but that is meaningless effort. Its good to extend the existing available Abstract class..

– Himmat Paliwal
Nov 26 '18 at 5:59














Okay and If i extend that class _ I want customers collection

– Aaditya
Nov 26 '18 at 6:00





Okay and If i extend that class _ I want customers collection

– Aaditya
Nov 26 '18 at 6:00













And I want all this in Model file that's why I asked that I need collection for that :)

– Aaditya
Nov 26 '18 at 6:01





And I want all this in Model file that's why I asked that I need collection for that :)

– Aaditya
Nov 26 '18 at 6:01

















draft saved

draft discarded
















































Thanks for contributing an answer to Magento Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f251219%2fhow-to-get-recently-viewed-products-collection-of-customer-magento-2%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?