FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
be2be/page-agregar.php at main · DARSOAD/be2be · GitHub
DARSOAD
/
be2be
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
be2be
/
page-agregar.php
Copy path
More file actions
More file actions
Latest commit
History
History
History
18 lines (17 loc) · 607 Bytes
Breadcrumbs
be2be
/
page-agregar.php
Copy path
File metadata and controls
18 lines (17 loc) · 607 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?php
header
(
"
Access-Control-Allow-Origin: *
"
);
$
id
=
$
_GET
[
'
id
'
];
$
cantidad
=
$
_GET
[
'
cantidad
'
];
$
color
=
$
_GET
[
'
color
'
];
$
talla
=
$
_GET
[
'
talla
'
];
$
id_v
;
$
product
=
new
WC_Product_Variable
(
$
id
);
$
variations
=
$
product
->
get_available_variations
();
foreach
(
$
variations
as
$
variation
) {
if
((
$
variation
[attributes][attribute_pa_color] ==
$
color
) && (
$
variation
[attributes][attribute_pa_talla] ==
$
talla
) ){
$
id_v
=
$
variation
[variation_id];}
}
$
variation
= [];
$
variation
[
'
attribute_pa_color
'
]=
$
color
;
$
variation
[
'
attribute_pa_talla
'
]=
$
talla
;
$
woocommerce
->
cart
->
add_to_cart
(
$
id
,
$
cantidad
,
$
id_v
,
$
variation
);
?>
Back
|
FazBrowse Home
|
New Git URL